Receiving sensor readings via the API
Note
Running the API is only available to RouteQ users with the Administrator role.
To receive readings of temperature sensors in vehicles via the API, make sure that the requests to the service are signed and contain the apikey parameter for authentication. For more information, see API key.
To view sensor values along the route, use the method sensor-values.
GET https://courier.yandex.ru/api/v1/companies/<your-company-id>/routes/<route-id>/sensor-values?apikey=[APIKEY]
The response contains a report on the temperature.
Response to a GET request
{
"next_page_token": <token of the next page>,
"results": [
{
"imei": <sensor's IMEI>,
"values": [ # list of sensor readings sorted by time and date
{
"time": <time in UNIX format>,
"value": <temperature value>,
},
"metadata": {
"timestamp_from": <start of readings interval in UNIX format>,
"timestamp_to": <end of readings interval in UNIX format>,
},
"sensor": { # sensor
"number": <sensor number>,
"name": <sensor name>
},
]
}
To request the next page of the report, in the page_token parameter, pass the next_page_token value you got in the previous response:
GET courier.yandex.ru/api/v1/companies/<your-company-id>/routes/<route-id>/sensor-values?page_token=[TOKEN]&apikey=[APIKEY]
If there are no more pages, you'll receive an empty response.
Was the article helpful?
Previous
Next