Below are the REST API which are required to retrieve measurements and events data based on deviceId.

Login to get Authentication Token:

Http-Method

Headers

Return Type

Request Body(Parameters with type)

Response Body

Description

End Point (Url)

POST

ContentType:application/json,

AcceptType:application/json

String

{
"password": "Redpine@123",
"username": "xyz@xyz.com"
}

Authentication token

Returns the Authentication token (used to invoke other rest api's)

https://quecloud.quessence.ai:2017
/login

 

Below are the Rest API'S used to get the device data:

 

To get the measurements data for single device:

Http-Method

Headers

Return Type

Request Body(Parameters with type)

Response Body

Description

End Point (Url)

POST

ContentType:application/json,

AcceptType:application/json,

Authorization:AuthenticationToken

(obtained in response, on successful login)

JSON Object

{
"deviceId": "0023A7A10967",
"measurementIds": [
"temperature","humidity"
],
"startDate": "2016-10-04T12:32:59.006Z",
"endDate": "2017-10-04T12:32:59.006Z"
}

{

"data":

[ { "deviceId": "0023A7A10967", "eventDate": "2017-02-17T15:07:49Z", "receivedDate": "2017-02-17T15:07:58Z", "measurements": [ { "name": "temperature", "value": 25.07 } ] },

"numResults": 1 }

Returns the measurement list in between the specified interval (start date and end date), for the specified measurement-Ids, device-Id.

Required Field: deviceId

Optional Fields: measurementIds,startDate,endDate

https://quecloud.quessence.ai:2017
/ai/measurements/singledevice

 

 

To get the measurements data for multiple devices:

Http-Method

Headers

Return Type

Request Body(Parameters with type)

Response Body

Description

End Point (Url)

POST

ContentType:application/json,

AcceptType:application/json,

Authorization:AuthenticationToken

(obtained in response, on successful login)

JSON Object

{
"deviceIds": [
"0023A7A18756","0023A7A18746"
],
"measurementIds": [
"heartrate","temperature"
],
"startDate": "2016-10-04T12:32:59.005Z",
"endDate": "2017-10-04T12:32:59.005Z"
}

{

"data": [ { "deviceId": "0023A7A18756", "eventDate":"2017-02-17T15:07:49Z", "receivedDate": "2017-02-17T15:07:58Z", "measurements": [ { "name": "heartrate", "value": 90 } ] },"numResults": 1 }

Returns the measurement list in between the specified interval (start date and end date),for the specified measurement-Ids, device-Ids.

Required Field:deviceIds

Optional Fields:measurementIds,startDate,endDate

https://quecloud.quessence.ai:2017
/ai/measurements/multipledevices

 

 

To get the events data for single device:

Http-Method

Headers

Return Type

Request Body(Parameters with type)

Response Body

Description

End Point (Url)

POST

ContentType:application/json,

AcceptType:application/json,

Authorization:AuthenticationToken

(obtained in response, on successful login)

JSON Object

{
"deviceId": "0023A7A10967",
"startDate": "2017-10-04T12:32:59.006Z",
"endDate": "2017-10-04T12:32:59.006Z",
"notificationTypes": [
"information","emergency"
],
"measurementIds": [
"heartrate"
]
}

{ "data": [ { "deviceId": "0023A7A10967", "notificationType": "information", "eventDate": "2017-09-26T13:32:48Z", "receivedDate": "2017-09-26T13:32:48Z", "anomalies": [ { "name": "heartrate", "value": 89 } ] },"numResults": 1}

Returns the anomalies list in between the specified interval (start date and end date), for the specified measurement-Ids, device-Id,notification type.

Required Field:deviceId

Optional Fields:measurementIds, startDate, endDate, notificationTypes

https://quecloud.quessence.ai:2017
/ai/events/singledevice

 

 

To get the events data for multiple devices:

Http-Method

Headers

Return Type

Request Body(Parameters with type)

Response Body

Description

End Point (Url)

POST

ContentType:application/json,

AcceptType:application/json,

Authorization:AuthenticationToken

(obtained in response, on successful login)

JSON Object

{
"deviceIds": [
"0023A7A10967","0023A7A10987"
],
"startDate": "2017-10-04T13:07:54.212Z",
"endDate": "2017-10-04T13:07:54.212Z",
"notificationTypes": [
"string"
],
"measurementIds": [
"string"
]
}

{ "data": [ { "deviceId": "0023A7A10987", "notificationType": "information", "eventDate": "2017-09-26T13:32:48Z", "receivedDate": "2017-09-26T13:32:48Z", "anomalies": [ { "name": "heartbeat", "value": 75 } ] },"numResults": 10 }

Returns the anomalies list in between the specified interval (start date and end date), for the specified measurement-Ids, device-Id,notification type.

Required Field:deviceIds

Optional Fields:measurementIds, startDate, endDate, notificationTypes

https://quecloud.quessence.ai:2017
/ai/events/multipledevices

 

 

To get the events notifications count:

Http-Method

Headers

Return Type

Request Body(Parameters with type)

Response Body

Description

End Point (Url)

Http-Method

Headers

Return Type

Request Body(Parameters with type)

Response Body

Description

End Point (Url)

GET

ContentType:application/json,

AcceptType:application/json,

Authorization:AuthenticationToken

(obtained in response, on successful login)

JSON Object   {"today":0,"lastMonth":7,"lastWeek":0} Returns the number of anomaly notifications occured for current day, last week and last month
https://quecloud.quessence.ai:2017
/ai/events/count