The Temperature API provides ambient temperature data for a specified asset. Temperature is measured in degrees Celsius and the range is -273.15 degrees C to 327.67 degrees C.
Use the following URL method structure to retrieve historical ambient temperature data for a selected asset.
METHOD: |
GET |
URI: |
<production url>/v1/assets/{id}/events?event-types=TEMP(start-ts,end-ts,size,page) |
SAMPLE URI: |
<production url>/v1/assets/1000000540/events?event-types=TEMP&start-ts=1453766605577&end-ts=1453772603879&size=10&page=1 |
Query Parameters
Parameter |
Description |
Required? |
Values |
id |
GE identifier for an asset. |
Yes |
For example, 1000000540. |
event-types |
Filter by type of event. |
Yes |
Temperature expressed as a string, such as TEMP. |
start-ts |
Start timestamp in milliseconds. |
Yes |
Numerical value, such as 1461517200000. |
end-ts |
End timestamp in milliseconds. |
Yes |
Numerical value, such as 1461689922665. |
page |
Page number. |
No |
Numerical value, such as 1. |
size |
Maximum number of records per page. If no size is specified, the default limit applies. |
No |
Numerical value, such as 2. |
Response Parameters
Parameter |
Data Type |
Required? |
Description |
_embedded |
Object |
Yes |
Time (seconds) spent in a particular zone. |
events |
Array |
Yes |
List of events. |
….measures |
Array |
Yes |
Provides the following values:- tag: TEMP
- value: 16.174
- unit: Celsius
|
….event-uid |
String |
Yes |
Unique identifier established by a customer or external resource for the event. In this example, value is null. |
….timestamp |
Number |
Yes |
Actual timestamp when event occurred, such as 1461648646658. |
….event-types |
String |
Yes |
Type of event recorded, such as TEMP. |
….device-uid |
String |
Yes |
Unique identifier established by a customer or external resource, such as Sensor_250_200. |
….location-uid |
String |
Yes |
Unique identifier established by a customer or external resource for a specific location within the monitored area, such as 1000000106. |
_links |
Object |
Yes |
HREFs related to this specific node.- self: Link to the asset details using the GE identifier. See the Get Asset Details section for information on obtaining additional data.
- next page: HREFs to navigate the result set using paging.
|
page |
Object |
Yes |
Pageable information satisfying the search filter. |
….size |
Number |
No |
Maximum number of records to return per page, such as 2. |
….totalElements |
Number |
No |
Total number of elements, such as 45. |
….totalPages |
Number |
No |
Total number of pages, such as 23. |
….number |
Number |
No |
Indicates the page number displayed when returned. Default value is 0. |
Sample Response
{
"_embedded": {
"events": [
{
"properties": {},
"measures": [
{
"tag": "TEMP",
"value": 16.174,
"unit": "Celsius"
}
],
"event-uid": null,
"timestamp": 1461648646658,
"event-type": "TEMP",
"device-uid": "Sensor_250_200",
"location-uid": "1000000106"
},
{
"properties": {},
"measures": [
{
"tag": "TEMP",
"value": 15.9227,
"unit": "Celsius"
}
],
"event-uid": null,
"timestamp": 1461650458290,
"event-type": "TEMP",
"device-uid": "Sensor_250_200",
"location-uid": "1000000105"
}
]
},
"_links": {
"self": {
"href": "http://ie-environmental.run.aws-usw02-pr.ice.predix.io/v1/assets/1000000540/events?event-types=TEMP&start-ts=1461517200000&end-ts=1461689922665&size=2"
},
"next-page": {
"href": "http://ie-environmental.run.aws-usw02-pr.ice.predix.io/v1/assets/1000000540/events?event-types=TEMP&start-ts=1461650458290&end-ts=1461689922665&size=2"
}
},
"page": {
"size": 2,
"totalElements": 45,
"totalPages": 23,
"number": 0
}
}