/device/data/get
Body
deviceID
- Type: String
- Examples:
"devicelfdzibp1qwso0jj7blg4a407"
path
(optional)
- Type: String
- Examples:
"state"
,"voltage"
,"temperature"
Success response
code
"DEVICE-DATA-FETCHED"
message
"Data for the device is successfully fetched: "
data
- Type: Number, Boolean, String, or Dictionary containing all variables and their values
- Examples:
20
,true
,"standby"
Error response
DATA-INVALID
{ code: "DATA-INVALID", message: "Device ID is required for fetching its data."}
DEVICE-ID-INVALID
{ code: "DEVICE-ID-INVALID", message: "Device is not registered with the project."}
PATH-INVALID
{ code: "PATH-INVALID", message: "Data is undefined at the specified path."}
Usage
curl "https://api.grandeur.tech/device/data/get?apiKey=${API_KEY}" -H "Authorization: ${AUTH_TOKEN}" --json '{"deviceID": "devicelfdzibp1qwso0jj7blg4a407", "path": "temperature"}'
Output
JSON
{
"code": "DEVICE-DATA-FETCHED",
"message": "Data for the device is successfully fetched: ",
"data": 30
}