Read Device Information

An API interface is provided to read the information of the Device, such as the location or the details of a Device.

This API can work synchronously or asynchronously when initiated from IMPACT IoT to the Adapter which then responds either right away for synchronous or with a notification for asynchronous. A correlator value is used to link the sent and received values.

IMPACT IoT will perform POST /devices operation on multiple resources depending on what objects are registered with the Device. This can be any information where read is permitted.

Examples include:

The entire tree, which is addressed with a /

  • Device Latitude
  • Device Longitude
  • Serving Mobile Network Code
  • Service Mobile Country Code
  • Device Serial Number

The object ID is omitted and all the information for all the objects that is readable is returned.

As described, the resources will be returned in the JSON format.

Note: The REST API call is triggered to the Adapter through IMPACT IoT Console.

An example of retrieving all the data associated with a Device is as follows.

Table 1. Read Device API format
Parameters Description
URL http://<adapter_hostname>:<port>/devices
Method POST
Content-Type application/json
Parameters

The parameters are:

  • device/0/endPointClientName - Specifies the Device serial number.
  • resource - Specifies the Device resource.
  • string - Specifies the resource value.
Sample Call The following is an example payload for configuring two APNs:
{"device/0/endPointClientName":"6npn1RTUtG",{
   "Write":[{
			"resource": "connectivity/0/apn",
			"string": "opco.com"
		},{
			"resource": "connectivity/1/apn",
			"string":"fis.com"
		}]
	}
}

Response Body:

{
"msg": "Success","code":1000
}
Success Code
Response Code: 200
Error Code
400 : Bad Request
401 : Unauthorized 
403 : Forbidden 
404 : Not Found 

Figure 1 shows the call flow when the Adapter returns the data synchronously.

Figure 1. Synchronous read

Figure 2 shows the call flow when the Adapter returns the data asynchronously.

Figure 2. Asynchronous read