References
/device
/data/set

/device/data/set

Body

deviceID

  • Type: String
  • Examples: "devicelfdzibp1qwso0jj7blg4a407"

path

  • Type: String
  • Examples: "state", "voltage", "temperature"

data

  • Type: Number, Boolean, or String
  • Examples: 20, true, "standby"

Success response

code

"DEVICE-DATA-UPDATED"

message

"Data of device is successfully updated."

path

  • Type: String
  • Examples: "temperature", "current", "state"

update

  • Type: Number, Boolean, String
  • 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."}

DEVICE-DATA-UPDATE-FAILED

{code: "DEVICE-DATA-UPDATE-FAILED", message: "Failed to update the data at the specified path."}


Usage

curl "https://api.grandeur.tech/device/data/set?apiKey=${API_KEY}" -H "Authorization: ${AUTH_TOKEN}" --json '{"deviceID": "devicelfdzibp1qwso0jj7blg4a407", "path": "temperature", "data": 30}'

Output

JSON
{
    "code": "DEVICE-DATA-UPDATED",
    "message": "Data of device is successfully updated.",
    "path": "temperature",
    "update": 30
}