FaviconSalkaro Docs

Upload Device Data

Guide to uploading device data via API with examples and key requirements.

Request Schema

The API endpoint expects the following JSON payload in the request body:

{
  "value": <number | string | boolean>,  // The measurement reading (e.g. temperature, humidity)
  "status": "<string>",                  // A status code or message (e.g. "OK", "ERROR")
  "timestamp": <integer>                 // UNIX timestamp in seconds (e.g. 1752696307)
}

Important:
The timestamp field must be a UNIX timestamp in seconds, not milliseconds.

URL Parameter Scheme

The API requires two query parameters in the URL:

ParameterTypeDescriptionExample
org_idstringThe organization IDv7pi4g3tYB8mu719ovIu
sensor_idstringThe unique sensor identifierBEaC9ZZDBntV9s3EnYQJ

Code Block

import requests
import json

url = "https://api.salkaro.com/v1/upload?org_id={org_id}&sensor_id={sensor_id}"

payload = json.dumps({
  "value": 28,
  "status": "OK",
  "timestamp": 1752696307
})
headers = {
  "Content-Type": "application/json",
  "Authorization": "Bearer API_KEY"
}

response = requests.post(url, headers=headers, data=payload)
print(response.text)

Responses

The API may return the following:

HTTP Status CodeResponse BodyDescription
202 Accepted{ "status": "accepted" }Data was successfully ingested.
400 Bad Requestplain textMalformed JSON, missing fields, or invalid values.
401 Unauthorizedplain textMissing or invalid Authorization header or API key.
402 Payment Requiredplain textQuota exceeded for the requested retention tier.
405 Method Not Allowedplain textHTTP method other than POST was used.
429 Too Many Requestsplain textRate limit exceeded for this (apiKey, sensorId) pair.
500 Internal Server Errorplain textServer‑side error (e.g., database write failure).