Thing API
The Thing API allows you to manage persistent entities like physical devices, rooms, or logical tasks. Unlike Events, Things have a long-term state and can hold static attributes.
Endpoints
Section titled “Endpoints”| Action | Method | Path |
|---|---|---|
| Create | POST | /v1/channel/{channel_id}/thing/create |
| Update | POST | /v1/channel/{channel_id}/thing/update |
| Archive | POST | /v1/channel/{channel_id}/thing/archive |
| Delete | POST | /v1/channel/{channel_id}/thing/delete |
Headers
Section titled “Headers”| Header | Value | Description |
|---|---|---|
Content-Type | application/json | Always required. |
Authorization | Bearer <token> | Your secret gateway token. |
Common Fields
Section titled “Common Fields”| Field | Type | Required | Description |
|---|---|---|---|
password | string | Yes | Channel password (8-128 chars). |
thing_id | string | No* | Unique ID for the thing. Required for Update, Archive, and Delete. |
thing_type | string | Yes | A category (e.g., thermometer, web_server). |
state | enum | No | ACTIVE, INACTIVE, DECOMMISSIONED. |
attrs | object | No | A JSON object containing current attributes (e.g., { "firmware": "1.0.2" }). |
Endpoint Details
Section titled “Endpoint Details”1. Create Thing
Section titled “1. Create Thing”Initialize a new persistent entity.
curl -X POST https://api.pushgo.io/v1/channel/ABC123XYZ/thing/create \ -H "Content-Type: application/json" \ -d '{ "password": "your_password", "thing_id": "living_room_temp", "thing_type": "sensor", "state": "ACTIVE", "attrs": { "location": "Floor 1" } }'2. Update Thing
Section titled “2. Update Thing”Modify attributes or the state of an existing thing. Attributes are merged.
curl -X POST https://api.pushgo.io/v1/channel/ABC123XYZ/thing/update \ -H "Content-Type: application/json" \ -d '{ "password": "your_password", "thing_id": "living_room_temp", "attrs": { "temperature": 22.5, "humidity": 45 } }'3. Archive / Delete
Section titled “3. Archive / Delete”- Archive: Keeps the data but hides it from the main view in the app.
- Delete: Permanently removes the thing and its history.
curl -X POST https://api.pushgo.io/v1/channel/ABC123XYZ/thing/archive \ -H "Content-Type: application/json" \ -d '{ "password": "your_password", "thing_id": "living_room_temp" }'Response
Section titled “Response”Successful requests return the thing_id:
{ "thing_id": "living_room_temp"}