SmartPill Device API Usage Guide
Follow these steps to interact with your devices and slots using the API.
-
🖊
Create Device:
POST /api/devices/create
Create a new device by providing name and unique mac address. -
📄
List Devices:
GET /devices
Retrieve all registered devices. -
🔔
Ping Device:
POST /api/devices/{mac}/ping
Ping a device by its MAC address to update its status. -
📋
Get Device Slots:
GET /api/devices/{mac}/slots
Retrieve all non-deleted slots for a device. This also resets the istoupdate flag. -
⚡
Randomize Slots:
POST /api/devices/{mac}/randomize-slots
Periodically call this to randomize and update slot configurations for a device. This sets istoupdate to true and updates updated_at.