{"id":32371,"date":"2022-02-03T15:23:17","date_gmt":"2022-02-03T21:23:17","guid":{"rendered":"http:\/\/www.multitech.net\/developer\/?page_id=32371"},"modified":"2022-02-03T15:35:30","modified_gmt":"2022-02-03T21:35:30","slug":"examples","status":"publish","type":"page","link":"https:\/\/www.multitech.net\/developer\/software\/devicehq\/account-api-extensions-for-task-management\/examples\/","title":{"rendered":"Examples"},"content":{"rendered":"<h4>Example 1 Set up a task for a device to install a custom app on its next check-in.<\/h4>\n<ol>\n<li>User logs in to www.devicehq.com and uploads a custom app.<\/li>\n<li>API client contacts the API and does GET \/api\/v2\/apps.<\/li>\n<li>Within the retrieved list, the account client fetches the ID field from the desired app.<\/li>\n<li>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.<\/li>\n<li>The device checks in to DeviceHQ<\/li>\n<li>The device retrieves the task, and completes it by installing the app.<\/li>\n<\/ol>\n<h4>Example 2 Set up a task for a device to install an app config<\/h4>\n<ol>\n<li>User logs in to www.devicehq.com and uploads a custom app.<\/li>\n<li>API client contacts API and does GET \/api\/v2\/apps<\/li>\n<li>Within the retrieved list the account client fetches the ID field from the desired app.<\/li>\n<li>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.<\/li>\n<li>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.<\/li>\n<li>The device checks in to DeviceHQ<\/li>\n<li>The device carries out the command to install the requested app config.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":537,"featured_media":0,"parent":32357,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-32371","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/32371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/users\/537"}],"replies":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/comments?post=32371"}],"version-history":[{"count":5,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/32371\/revisions"}],"predecessor-version":[{"id":32374,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/32371\/revisions\/32374"}],"up":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/32357"}],"wp:attachment":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/media?parent=32371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}