Getting Started
The Onwords Smart Device API allows you to control your connected devices programmatically.
Base URL
https://ostapi.onwords.inReal-time Control
Instant device control via MQTT
Secure
API key authentication
RESTful
Standard REST endpoints
JSON
Clean JSON responses
Authentication
All API requests require authentication using the x-api-key header.
Get your API key
Email us at [email protected] to get your API key.
Request Headers
x-api-key: YOUR_API_KEY
Content-Type: application/jsonGate Control API
Control your gate modules - open, close, and pause.
Supported Gate Types
3chsgSliding Gate
3chagArm Gate
3chsgslSliding Gate Advanced
POST
/control-device/Control the gate - open, close, or pause
Request Body
{
"action": "open",
"product_id": "3chsg_xxxxx"
}Response
{
"status": "success",
"product_id": "3chsg_xxxxx",
"gate_type": "Sliding Gate"
}Available Actions
| Gate Type | Actions |
|---|---|
| Sliding Gate | open, close, pause |
| Arm Gate | open_single_gate, close_single_gate, open_double_gate, close_double_gate |
| Sliding Gate Advanced | open, close, pause, partial_open |
3CH Relay API
Control individual channels on your 3-channel relay module.
POST
/control-device/Control relay channel
Request Body
{
"action": "on",
"product_id": "3chrelay_xxxxx",
"channel": 1
}Response
{
"status": "success",
"product_id": "3chrelay_xxxxx",
"channel": 1,
"state": "on"
}Error Handling
200
Success
Request completed
400
Bad Request
Invalid action or parameters
403
Forbidden
Invalid API key or unauthorized product
404
Not Found
User or gate type not found
Error Response
{
"detail": "Invalid API key"
}