HTTPS is a supported direct request/response transport for firmware that polls Realer for catalog state and posts command acknowledgements or sensor readings through direct iot/v1 requests.
OAuth token issue and renewal happen over HTTPS. This page describes the HTTPS runtime loop after the device has authenticated.
The public device API is served from https://api.therealer.com/iot/v1/.... Plain HTTP is not accepted for public device traffic.
This page summarizes the HTTPS runtime sequence. The linked reference pages document request headers, parameters, examples, and response shapes.
Typical HTTPS firmware can omit the OAuth scope parameter; Realer then issues the default HTTPS scopes for catalog reads and feed-data writes. Use the authentication page when you need the full scope reference.
| Step | Endpoint or reference | Firmware purpose |
|---|---|---|
| Authenticate | OAuth device authentication | Issue or renew the Bearer access token. |
| Read catalog | Device catalog | Read command desired state and sensor definitions. |
| Report state | Feed-data ingestion | Send command acknowledgements, local physical command changes, and sensor values. |
| Handle responses | Response codes | Use stable application-level code values for firmware behavior regardless of HTTP status grouping. |
| Handle field behavior | Field semantics | Use the shared rules for message_id, desired_id, report_status, expiry, and application results. |
POST /oauth/token with grant_type=client_credentials. For a normal HTTPS-only device, omit scope or request iot:catalog:read iot:feed-data:write.
GET /iot/v1/devices/{device_id}/commands and GET /iot/v1/devices/{device_id}/sensors with Authorization: Bearer <access_token>.
POST /iot/v1/devices/{device_id}/feed-data or POST /iot/v1/devices/{device_id}/feed-data/batches with command acknowledgements and sensor readings.
renew_after to request a new access token before expiry. If renewal fails, authenticate again before protected iot/v1 requests continue.
Feed-data requests use JSON over HTTPS and return application-level results in the response body.
curl "https://api.therealer.com/iot/v1/devices/12345/feed-data" \
-X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer b11db7f6c816568eb3b156df3aeaa5' \
-d '{"sensor_id":7,"value":"21.4","value_received_at":"2026-04-24T10:15:00Z","message_id":"sensor-7-20260424T101500Z"}'
Send one command acknowledgement or one sensor reading over HTTPS.
The Bearer access token obtained from the OAuth token endpoint.
Type: String
Example: Bearer b11db7f6c816568eb3b156df3aeaa5
The request body media type.
Value: application/json
ID (id) of the authenticated control device that is sending feed data.
Type: Integer
Example: 12345
{
"sensor_id": 7,
"value": "21.4",
"value_received_at": "2026-04-24T10:15:00Z",
"message_id": "sensor-7-20260424T101500Z"
}
Schema: http-feed-data-item.schema.json
Exactly one of command_id or sensor_id is required.
Use for sensor readings instead of command_id.
Raw source value to validate through the canonical semantic contract.
Canonical source event time for the submitted value.
Transport-level idempotency key scoped to the authenticated device and semantic source.
Optional Realer desired-state id when this command report answers a command sent by Realer.
Optional command outcome for reports with desired_id: applied, rejected, or stale. For local physical command reports, omit this field; if sent without desired_id, only reported is valid.
201 Created
{
"code": 2000,
"status": "created",
"feed_data_id": 123,
"message_id": "sensor-7-20260424T101500Z",
"warnings": []
}
422 Unprocessable Content
Validation failure
{
"code": 4022,
"error": {
"type": "validation_failed",
"message": "feed data ingestion failed",
"details": {
"sensor_id": ["is invalid for this device"]
}
},
"request_id": "..."
}
Schema: http-error-response.schema.json
code field and, when present, error.type for stable device behavior.
| HTTP or application result | Firmware handling |
|---|---|
2xx HTTP with code 2000 |
Accept the application result and continue the local loop. |
2xx HTTP with feed-data status idempotent |
Treat the replay as success for the same message_id. |
4xx HTTP with stable numeric code |
Use the response-code contract for local behavior. Do not retry blindly unless the documented error is retryable for the device. |
401 or expired token |
Request a new OAuth token, then retry only the current safe operation with the same idempotency key when applicable. |
5xx, timeout, or network failure |
Keep or enter local safe behavior, then retry with backoff and stable message_id values for the same physical event. |
Command catalog values represent desired state from Realer. Sensor catalog entries describe values the device can report.
report_status set to rejected or stale.desired_id.message_id.Use the MQTT flow when firmware keeps a broker connection open, needs command desired-state messages without polling, publishes feed data with MQTT over TLS, or needs asynchronous application acknowledgements on a subscribed topic.