TEST environment
https://dev.dashboard.smapplab.com
5 days
PRODUCTION environment:
https://dashboard.smapplab.com
5 hours
Description
Authentication endpoint for obtaining an access token to access data endpoints.
Get auth token
Request body
{
"username": "clientusername",
"password": "clientpassword"
}
example response:
{
"refresh": "exampleaccesstoken",
"access": "examplerefreshtoken"
}
Response format
{
"meta": {
"next": "/api/devices/?page=3&page_size=20", // null, if there is no more page
"previous": "/api/devices/?page=1&page_size=20", // null, if there is no more page
"count": 420, // total size of elements
"page": 2,
"page_size": 20
},
"data": [
{
...
}
]
}
API Endpoint: GET /api/devices/
Description
Devices endpoint for retrieving data specifically related to trap devices.
Request body
No request body
Authorization header
'Authorization: Bearer EXAMPLEACCESSTOKEN'
Example response:
{
"id": "exampledeviceUUID",
"most_relevant_geo_point": {
"latitude": "47.5118305060",
"longitude": "19.0377206591"
},
"smapp_id": "SMP-0000",
"name": "Name of device",
"current_pest": "exampleuuid",
"current_crop": "exampleuuid",
"last_measurement": "exampleuuid",
"last_network_diagnostic": "exampleuuid",
}
API Endpoint: GET /api/pests/
Description
Pest endpoint for retrieving detailed pest data by pest id.
Querystring parameters:
id__in=id1,id2 // ids are the current_pest uuids from the devices endpoint
Authorization header
'Authorization: Bearer EXAMPLEACCESSTOKEN'
Example response:
[
{
"id": "1903ec84-2fb0-4c9c-8fb3-c27ac4a2eb03",
"created_at": 0,
"updated_at": 0,
"comment": "string",
"name": "string"
}
]
API Endpoint: GET /api/crops
Description
Crops endpoint for retrieving detailed crop data by crop id.
Querystring parameters:
id__in=id1,id2 // ids are the current_crop uuids from the devices endpoint
Authorization header
'Authorization: Bearer EXAMPLEACCESSTOKEN'
Example response:
[
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"created_at": 0,
"updated_at": 0,
"comment": "string",
"name": "string"
}
]
Get list of images and detection counts related to image
Description
Images endpoint for retrieving images by device id.
Querystring parameters:
device__id=exampledeviceid // ids are the id uuids from the devices endpoint
Authorization header
'Authorization: Bearer EXAMPLEACCESSTOKEN'
Example response:
[
{
"id": "example image uuid",
"created_at": 0,
"detection_count": "number",
"detection_count_delta": "number",
"device": "device_id"
}
]
Description
Images endpoint for downloading specific image by image id.
Querystring parameters:
type=validated
Authorization header
'Authorization: Bearer EXAMPLEACCESSTOKEN'
Example response:
Blob image (type: image/jpeg)
Description
Measurements endpoint for retrieving measurements by device ids.
Querystring parameters:
device__id__in=id1,id2 // ids are the last_measurement uuids from the devices endpoint
Authorization header
'Authorization: Bearer EXAMPLEACCESSTOKEN'
Example response:
{
"id": "measurementuuid",
"battery_voltage": "4.2",
"solar_cell_voltage": "4.3",
"temperature": 0, // celsius, not provided by mini devices
"humidity": 34, // percentage, not provided by mini devices
"light": 0, // percentage
"created_at": 0,
"device": "deviceuuid"
}
Description
Network diagnostics endpoint for retrieving network diagnostic by device ids.
Querystring parameters:
device__id__in=id1,id2 // ids are the last_measurement uuids from the devices endpoint
Authorization header
'Authorization: Bearer EXAMPLEACCESSTOKEN'
Example response:
{
"id": "networkdiagnosticsuuid",
"created_at": 0,
"service": "egsmmode", // service for device modem
"operator": "21630",
"band": "EUTRAN-BAND28",
"channel": "352",
"cell": "111628",
"rssi": -55.0,
"ip": "ipaddress",
"device": "ca65ab35-6112-4831-ac47-a7f4848e0958"
},
Description
Catch count deltas endpoint for retrieving catch count and catch count deltas on a daily and weekly bases by device ids.
Querystring parameters:
device_ids=id1,id2 // ids are the id uuids from the devices endpoint
Authorization header
'Authorization: Bearer EXAMPLEACCESSTOKEN'
Example response:
[
{
"id": "deviceuuid",
"day": {
"dc": 0, // today detection count
"dcd": 0 // today detection count delta
},
"week": {
"dc": 0, // 7 days detection count
"dcd": 0 // 7 days detection count delta
}
}
]