Examples
Example 1 Set up a task for a device to install a custom app on its next check-in.
- User logs in to www.devicehq.com and uploads a custom app.
- API client contacts the API and does GET /api/v2/apps.
- Within the retrieved list, the account client fetches the ID field from the desired app.
- The API client makes a request: POST /api/v2/devices/{device- id}/task, with the payload completed with the necessary data (app id, app version, etc.). The request succeeds.
- The device checks in to DeviceHQ
- The device retrieves the task, and completes it by installing the app.
Example 2 Set up a task for a device to install an app config
- User logs in to www.devicehq.com and uploads a custom app.
- API client contacts API and does GET /api/v2/apps
- Within the retrieved list the account client fetches the ID field from the desired app.
- The account client makes a request: GET /api/v2/apps/{app id}, and examines its app_configs field to find the ID of the desired app config.
- The API client makes a request: POST /api/v2/devices/{device- id}/task, with the payload completed with the necessary data containing the app config ID. The request succeeds.
- The device checks in to DeviceHQ
- The device carries out the command to install the requested app config.