Examples

Example 1 Set up a task for a device to install a custom app on its next check-in.

  1. User logs in to www.devicehq.com and uploads a custom app.
  2. API client contacts the API and does GET /api/v2/apps.
  3. Within the retrieved list, the account client fetches the ID field from the desired app.
  4. 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.
  5. The device checks in to DeviceHQ
  6. 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

  1. User logs in to www.devicehq.com and uploads a custom app.
  2. API client contacts API and does GET /api/v2/apps
  3. Within the retrieved list the account client fetches the ID field from the desired app.
  4. 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.
  5. 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.
  6. The device checks in to DeviceHQ
  7. The device carries out the command to install the requested app config.