Data Notifications

This is used for the purpose of sending data notifications generated due to a previous data observation call issued by the Adapter.

The following table provides details on the API and the different string formats; numeric value, string or an array of values, that can be provided. If the value for the token notify2 is an array of JSON objects, then the Adapter can take advantage to package events from multiple Devices in the same POST message.

The JSON object is a triplet, “device/0/endPointClientName”, “resource”,”value”

Table 1. Data notications API format
Parameters Description
URL http://<impact_hostname>:<port>/m2m/device
Method POST
Content-Type application/json
Parameters

The parameters are:

  • device/1/endPointClientName - Specifies the Device Id.
  • resource - Specifies the Device resource.
  • string - Specifies the resource value, which can be any of the following:
    • Numeric value
    • String
    • An array
Sample Call

{
"notify2":[{
    "device/1/endPointClientName":"TTo1AZliuT", 
    "resource":"device/0/status",
    "value":"5"
}],
}

{
    "notify2":[{ 
    "device/0/endPointClientName":"TTo1AZliuT", 
    "resource":"device/0/status",
    "value":5
}]
}

{
    "notify2":[{ 
    "device/0/endPointClientName":"TTo1AZliuT", 
    "resource":"device/0/status",
    "value":[5,7]
}]
}

Response Body:

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