Authentication
API keys
Section titled “API keys”Every call carries the project’s API key in the x-header-apikey header:
curl "https://openapi.rogo.com.vn/api/v2.0/iot-core/device/<userId>" \ -H "x-header-apikey: $API_KEY"Create keys in the dashboard: project → Cloud Services → API keys.
- A project can have several keys. Give each a label, such as the server that uses it.
- To replace a key: add a new one, move your servers to it, then revoke the old one. The last key cannot be revoked by mistake: you are asked to confirm.
- Keys are only for servers. Never put one in an app or a web page.
IP whitelist
Section titled “IP whitelist”A key only works from an address in the project’s whitelist. Add each server’s public address, one by one; ranges are not supported.
Acting for an app user
Section titled “Acting for an app user”Most routes take a userId: the app user whose homes and devices you read or change. The key only gives
access to users of its own project. A user of another project answers 1006.
To sign a user in to your app from your own server, see Signing users in with your own token service.
Errors
Section titled “Errors”| Code | Meaning |
|---|---|
1001 |
The key is missing or not valid |
1105 |
The calling address is not in the whitelist |
1006 |
The user is not in this key’s project |
400 |
The project does not have the IoT Core service switched on. The message says which service |
Every code is in Error codes.