Groups
Rooms and other groups of devices inside a location.
Every call needs the project’s API key in x-header-apikey. See Authentication. Errors use the codes in Error codes.
Get user group by uuid
Section titled “Get user group by uuid”GET https://openapi.rogo.com.vn/api/v2.0/iot-core/group/{userId}/{uuid}| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
uuid |
path | string | Yes | |
userId |
path | string | Yes |
curl -X GET "https://openapi.rogo.com.vn/api/v2.0/iot-core/group/<userId>/<uuid>" \ -H "x-header-apikey: $API_KEY"| Status | Meaning |
|---|---|
| 200 |
Example answer
{ "uuid": "string", "label": "string", "desc": "string", "userId": "string", "locationId": "string", "type": 0, "elementId": 0}Get All User’s groups
Section titled “Get All User’s groups”GET https://openapi.rogo.com.vn/api/v2.0/iot-core/group/{userId}| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
locationId |
query | string | No | if locationId input null in params, auto get all group from this user |
userId |
path | string | Yes |
curl -X GET "https://openapi.rogo.com.vn/api/v2.0/iot-core/group/<userId>" \ -H "x-header-apikey: $API_KEY"| Status | Meaning |
|---|---|
| 200 |
Example answer
[ { "uuid": "string", "label": "string", "desc": "string", "userId": "string", "locationId": "string", "type": 0, "elementId": 0 }]Add a group to user
Section titled “Add a group to user”POST https://openapi.rogo.com.vn/api/v2.0/iot-core/group/{userId}| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
userId |
path | string | Yes |
Body
| Field | Type | Required | Description |
|---|---|---|---|
label |
string | Yes | |
locationId |
string | Yes | |
desc |
string | Yes | |
type |
number | Yes | if type is null, default = 0, if not null, type is only value between 0 - 1 |
curl -X POST "https://openapi.rogo.com.vn/api/v2.0/iot-core/group/<userId>" \ -H "x-header-apikey: $API_KEY" \ -H "content-type: application/json" \ -d '{"label":"string","locationId":"string","desc":"string","type":0}'| Status | Meaning |
|---|---|
| default |
Update user’s group
Section titled “Update user’s group”PATCH https://openapi.rogo.com.vn/api/v2.0/iot-core/group/{userId}| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
userId |
path | string | Yes |
Body
| Field | Type | Required | Description |
|---|---|---|---|
uuid |
string | Yes | |
label |
string | Yes | |
desc |
string | Yes |
curl -X PATCH "https://openapi.rogo.com.vn/api/v2.0/iot-core/group/<userId>" \ -H "x-header-apikey: $API_KEY" \ -H "content-type: application/json" \ -d '{"uuid":"string","label":"string","desc":"string"}'| Status | Meaning |
|---|---|
| 200 |
Example answer
{ "uuid": "string", "success": true}Delete user’s group
Section titled “Delete user’s group”DELETE https://openapi.rogo.com.vn/api/v2.0/iot-core/group/{userId}| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
userId |
path | string | Yes |
Body
| Field | Type | Required | Description |
|---|---|---|---|
uuid |
string | No |
curl -X DELETE "https://openapi.rogo.com.vn/api/v2.0/iot-core/group/<userId>" \ -H "x-header-apikey: $API_KEY" \ -H "content-type: application/json" \ -d '{"uuid":"string"}'| Status | Meaning |
|---|---|
| 200 |
Example answer
{ "uuid": "string", "success": true}