Downlink Execute Command

Last modified: Jun 6, 2019 @ 09:21

The “Execute” command implies that the application is executing payload to the device. This command expects only one response from the device.

Sample request on the device

{

"token" : "7dc53df5-703e-49b3-8670-b1c468f47f1f",

"op" : "EXECUTE",

"ct" : "application/senml+json",

"payload" : [{"n":"/3303/0/5605"}]

}

Sample response from the device

{

"token" : "7dc53df5-703e-49b3-8670-b1c468f47f1f",

"code" : "201"

}
  • op” is the type of the operation to be performed. For example, EXECUTE.
  • ct” is the content type of the MQTT payload.
  • payload” contains the SenML that has the link of the IPSO resource upon which the execute operation should be performed by the device.

DDM GUI initiated Execute

  • Navigate to an executable Resource.
  • Click Execute of the corresponding resource to initiate an Execute request for the resource.

  • The sample response received for ‘Reset Min and Max Measured Values‘ execute operation is shown below. To see the log, navigate to the resource page.

Send Execute command to device using API

{id}/execute
Title Execute
URL swagger/ui/index#!/Resource/Resource_ExecuteResource_0
Method PUT
Parameters 1.     Id

2.     ExecuteRequest

Parameter content type: application/json

ExecuteRequest

{

"Id": "string",
"SendRequestSynchronously": true

}

3.     X-DeviceNetwork

Note: ‘ID’ is the Resource ID. Fetch the resource ID of an executable resource from DDM as described earlier. ‘X-DeviceNetwork’ is the Device Network ID. Fetch the ‘device_network_id’ as described earlier. ExecuteRequest is a type of application/json. ID is same as the Resource ID.

Response Messages
HTTP Status Code Reason
204 No Content
400 Resource is not readable
401 Unauthorized
404 Resource not found
  • After fetching the resource list, Navigate to Resource ->Get/api/v3/resources/{id}/execute.

  • Fill the required fields as described in the table and click Try it out!

  • After successful transaction, the sample response received for ‘Reset Min and Max Measured Values’ execute operation is shown below. To see the log, navigate to the resource page.