Read the resource of an endpoint

Read the resource of an endpoint describes the API structure for the reading the resources of an endpoint device.

Table 1. Read the resource of an endpoint
Title Read the resource of an endpoint
URL http://<impact_url>/m2m/endpoints/{serialNumber}/{resourcePath}
Method GET
Content-Type application/json
URL Params

The following are the URL parameters:

  • serialNumber: [string]: Specifies the serial number of device whose resource details are required.

  • resourcePath: Specifies the URI of the resource on which the client application wants to perform the read operation. Depending on the nature of the request, it can consists of one or more of the following parameters in the defined syntax:

    • objectId: [string]: Specifies the unique identity of the object within the client.

    • objectInstanceId: [string]: Specifies the unique identity of the object instance of the object within the client.

    • resourceId: [string]: Specifies the unique identity of the resource within the object.

    • resourceInstanceId: [string]: Specifies the unique identity of the resource instance within the resource.

    The possible input syntax for resourcePath are:

    • ObectId
    • ObectId/InstanceId
    • ObectId/InstanceId/ResourceID
    • ObectId/InstanceId/ResourceID/ResourceInstanceID
    Note:

    If a resource path does not exist for the device, yet it is mentioned in the request, then IMPACT IoT does not validate the resource path and accepts the request. Final response to callback URL contains the result code and error message, if any.

  • needNotification: [Boolean]: The flag that indicates where a wake up trigger is required, to process the command.

    The default value is false. When set to false, the wake up trigger is not sent to the device.

Data Params

requestId: [string]: Specifies the request ID provided in case of valid and accepted request

msg:[string] : info/warning/error message

Success Code
Response Code: 202
Error Code
400 : Bad Request 
401 : Unauthorized 
403 : Forbidden 
404 : Not Found
Sample Call

1. Read the resources of an endpoint with object ID.

Curl:
curl -X GET --header 'Accept: application/json'  --header 'Authorization: Basic ZG9jdXNlcjpBc2RmMSM=' 'http://<impact_url>/m2m/endpoints/DEVKIT_779/3’
Response Body:
{
  "requestId": "53782880-77c3-4281-a849-aa934accb7f5",
  "msg": "Accepted"
}
Final Response to callback URL:
{"reports":[],"registrations":[],"deregistrations":[],"updates":[],"expirations":[],"responses":[{"serialNumber":"DEVKIT_779","timestamp":1484206109976,"requestId":"53782880-77c3-4281-a849-aa934accb7f5","creationDate":null,"make":null,"model":null,"firmwareVersion":null,"groupName":null,"imsi":null,"address":null,"freeFormAddress":null,"protocol":"LWM2M","resources":[{"resourcePath":"3","value":"{\"3/0/2\":\"345000123\",\"3/0/1\":\"Lightweight M2M Client\",\"3/0/0\":\"Open Mobile Alliance\",\"3/0/16\":\"U\",\"3/0/6/1\":\"5\",\"3/0/6/0\":\"1\",\"3/0/7/1\":\"5000\",\"3/0/9\":\"100\",\"3/0/11/0\":\"0\",\"3/0/7/0\":\"3800\",\"3/0/8/1\":\"900\",\"3/0/3\":\"1.0\",\"3/0/8/0\":\"125\",\"3/0/10\":\"15\",\"3/0/13\":\"Thu May 02 06:40:15 EDT 2013\",\"3/0/14\":\"+02:00\"}"}],"result":{"code":0,"subCode":null,"reason":"Success"}}]}

2. Read the resources of an endpoint with object ID and instance ID.

Curl:
curl -X GET --header 'Accept: application/json'  --header 'Authorization: Basic ZG9jdXNlcjpBc2RmMSM=' 'http://<impact_url>/m2m/endpoints/DEVKIT_779/3/0'
Response Body:
{
  "requestId": "7be7a015-7b48-477a-89e2-3124e754bea5",
  "msg": "Accepted"
}
Final Response to callback URL:
{"reports":[],"registrations":[],"deregistrations":[],"updates":[],"expirations":[],"responses":[{"serialNumber":"DEVKIT_779","timestamp":1484206214402,"requestId":"7be7a015-7b48-477a-89e2-3124e754bea5","creationDate":null,"make":null,"model":null,"firmwareVersion":null,"groupName":null,"imsi":null,"address":null,"freeFormAddress":null,"protocol":"LWM2M","resources":[{"resourcePath":"3/0","value":"{\"3/0/2\":\"345000123\",\"3/0/1\":\"Lightweight M2M Client\",\"3/0/0\":\"Open Mobile Alliance\",\"3/0/16\":\"U\",\"3/0/6/1\":\"5\",\"3/0/6/0\":\"1\",\"3/0/7/1\":\"5000\",\"3/0/9\":\"100\",\"3/0/11/0\":\"0\",\"3/0/7/0\":\"3800\",\"3/0/8/1\":\"900\",\"3/0/3\":\"1.0\",\"3/0/8/0\":\"125\",\"3/0/10\":\"15\",\"3/0/13\":\"Thu May 02 06:40:15 EDT 2013\",\"3/0/14\":\"+02:00\"}"}],"result":{"code":0,"subCode":null,"reason":"Success"}}]}

3. Read the resources of an endpoint with object ID, Instance ID, and resource ID.

Curl:
curl -X GET --header 'Accept: application/json'  --header 'Authorization: Basic ZG9jdXNlcjpBc2RmMSM=' 'http://<impact_url>/m2m/endpoints/DEVKIT_779/3/0/9'
Response Body:
{
  "requestId": "3bc33b95-6a65-4aa2-8fd6-927993f08de7
 ",
  "msg": "Accepted"
}
Final Response to callback URL:
{"reports":[],"registrations":[],"deregistrations":[],"updates":[],"expirations":[],"responses":[{"serialNumber":"DEVKIT_779","timestamp":1484206240383,"requestId":"3bc33b95-6a65-4aa2-8fd6-927993f08de7","creationDate":null,"make":null,"model":null,"firmwareVersion":null,"groupName":null,"imsi":null,"address":null,"freeFormAddress":null,"protocol":"LWM2M","resources":[{"resourcePath":"3/0/9","value":"{\"3/0/9\":\"100\"}"}],"result":{"code":0,"subCode":null,"reason":"Success"}}]}

4. Read the resources of an endpoint with object ID, Instance ID , resource ID, and instance resource ID

Curl:
curl -X GET --header 'Accept: application/json'  --header 'Authorization: Basic ZG9jdXNlcjpBc2RmMSM=' 'http://<impact_url>/m2m/endpoints/DEVKIT_779/3/0/7/1'
Response Body:
{
  "requestId": "04139ca8-2d7f-4e88-8ccf-334f7cecba73
",
  "msg": "Accepted"
}
Final Response to callback URL:
{"reports":[],"registrations":[],"deregistrations":[],"updates":[],"expirations":[],"responses":[{"serialNumber":"DEVKIT_779","timestamp":1484206434804,"requestId":"04139ca8-2d7f-4e88-8ccf-334f7cecba73","creationDate":null,"make":null,"model":null,"firmwareVersion":null,"groupName":null,"imsi":null,"address":null,"freeFormAddress":null,"protocol":"LWM2M","resources":[{"resourcePath":"3/0/7/1","value":"{\"3/0/7/1/1\":\"5000\",\"3/0/7/1/0\":\"3800\"}"}],"result":{"code":0,"subCode":null,"reason":"Success"}}]}
Notes None