Sharing
Devices and locations shared between users.
Every call needs the project’s API key in x-header-apikey. See Authentication. Errors use the codes in Error codes.
Add share device
Section titled “Add share device”POST https://openapi.rogo.com.vn/api/v2.0/iot-core/share/entity/addBody
| Field | Type | Required | Description |
|---|---|---|---|
shareId |
string | Yes | |
type |
dev \ |
loc |
Yes |
subType |
dev \ |
loc |
Yes |
byUserId |
string | Yes | |
toUserId |
string | Yes | |
permission |
0 |
Yes | |
elements |
number[] | No |
curl -X POST "https://openapi.rogo.com.vn/api/v2.0/iot-core/share/entity/add" \ -H "x-header-apikey: $API_KEY" \ -H "content-type: application/json" \ -d '{"shareId":"string","type":"dev","subType":"dev","byUserId":"string","toUserId":"string","permission":0,"elements":[0]}'| Status | Meaning |
|---|---|
| 201 |
Example answer
{ "shareEntity": {}, "shareAccess": {}}Remove share entity
Section titled “Remove share entity”DELETE https://openapi.rogo.com.vn/api/v2.0/iot-core/share/entity/deleteBody
| Field | Type | Required | Description |
|---|---|---|---|
uuid |
string | No |
curl -X DELETE "https://openapi.rogo.com.vn/api/v2.0/iot-core/share/entity/delete" \ -H "x-header-apikey: $API_KEY" \ -H "content-type: application/json" \ -d '{"uuid":"string"}'| Status | Meaning |
|---|---|
| default |
Get one share entity by owner
Section titled “Get one share entity by owner”GET https://openapi.rogo.com.vn/api/v2.0/iot-core/share/entity/getbyowner/{userId}/{shareId}| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
userId |
path | string | Yes | |
shareId |
path | string | Yes |
curl -X GET "https://openapi.rogo.com.vn/api/v2.0/iot-core/share/entity/getbyowner/<userId>/<shareId>" \ -H "x-header-apikey: $API_KEY"| Status | Meaning |
|---|---|
| default |
Get one share entity by shared user
Section titled “Get one share entity by shared user”GET https://openapi.rogo.com.vn/api/v2.0/iot-core/share/entity/getbyshared/{userId}/{shareId}| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
userId |
path | string | Yes | |
shareId |
path | string | Yes |
curl -X GET "https://openapi.rogo.com.vn/api/v2.0/iot-core/share/entity/getbyshared/<userId>/<shareId>" \ -H "x-header-apikey: $API_KEY"| Status | Meaning |
|---|---|
| default |
Get all share entities by owner
Section titled “Get all share entities by owner”GET https://openapi.rogo.com.vn/api/v2.0/iot-core/share/entity/getbyowner/{userId}| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
userId |
path | string | Yes |
curl -X GET "https://openapi.rogo.com.vn/api/v2.0/iot-core/share/entity/getbyowner/<userId>" \ -H "x-header-apikey: $API_KEY"| Status | Meaning |
|---|---|
| default |
Get all share entities by shared user
Section titled “Get all share entities by shared user”GET https://openapi.rogo.com.vn/api/v2.0/iot-core/share/entity/getbyshared/{userId}| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
userId |
path | string | Yes |
curl -X GET "https://openapi.rogo.com.vn/api/v2.0/iot-core/share/entity/getbyshared/<userId>" \ -H "x-header-apikey: $API_KEY"| Status | Meaning |
|---|---|
| default |
Remove share access
Section titled “Remove share access”DELETE https://openapi.rogo.com.vn/api/v2.0/iot-core/share/access/deleteBody
| Field | Type | Required | Description |
|---|---|---|---|
uuid |
string | No |
curl -X DELETE "https://openapi.rogo.com.vn/api/v2.0/iot-core/share/access/delete" \ -H "x-header-apikey: $API_KEY" \ -H "content-type: application/json" \ -d '{"uuid":"string"}'| Status | Meaning |
|---|---|
| 200 | Share access removed successfully |
Example answer
{ "success": true, "uuid": "string"}Get all share accesses by owner
Section titled “Get all share accesses by owner”GET https://openapi.rogo.com.vn/api/v2.0/iot-core/share/access/getbyowner/{userId}| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
userId |
path | string | Yes |
curl -X GET "https://openapi.rogo.com.vn/api/v2.0/iot-core/share/access/getbyowner/<userId>" \ -H "x-header-apikey: $API_KEY"| Status | Meaning |
|---|---|
| default |
Get all share accesses by shared user
Section titled “Get all share accesses by shared user”GET https://openapi.rogo.com.vn/api/v2.0/iot-core/share/access/getbyshared/{userId}| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
userId |
path | string | Yes |
curl -X GET "https://openapi.rogo.com.vn/api/v2.0/iot-core/share/access/getbyshared/<userId>" \ -H "x-header-apikey: $API_KEY"| Status | Meaning |
|---|---|
| default |
Get state by device ID
Section titled “Get state by device ID”GET https://openapi.rogo.com.vn/api/v2.0/iot-core/share/state/device/{deviceId}| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
deviceId |
path | string | Yes | |
shareKey |
query | string | Yes |
curl -X GET "https://openapi.rogo.com.vn/api/v2.0/iot-core/share/state/device/<deviceId>" \ -H "x-header-apikey: $API_KEY"| Status | Meaning |
|---|---|
| 200 | Return state by device ID |
Example answer
{ "uuid": "string", "loc": "string", "mac": "string", "from": "string", "state": {}, "time": "2026-12-03T00:00:00.000Z", "prevState": {}, "devId": "string"}Get state by location ID
Section titled “Get state by location ID”GET https://openapi.rogo.com.vn/api/v2.0/iot-core/share/state/location/{locationId}| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
locationId |
path | string | Yes | |
toUserId |
query | string | Yes |
curl -X GET "https://openapi.rogo.com.vn/api/v2.0/iot-core/share/state/location/<locationId>" \ -H "x-header-apikey: $API_KEY"| Status | Meaning |
|---|---|
| 200 | Return states by location ID |
Example answer
{ "uuid": "string", "loc": "string", "mac": "string", "from": "string", "state": {}, "time": "2026-12-03T00:00:00.000Z", "prevState": {}, "devId": "string"}Control a device
Section titled “Control a device”POST https://openapi.rogo.com.vn/api/v2.0/iot-core/share/control/{deviceId}| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
deviceId |
path | string | Yes |
Body
| Field | Type | Required | Description |
|---|---|---|---|
elementIds |
string[] | Yes | List of Element IDs |
command |
string[] | Yes | Command details as an array where the first element is the attribute and the rest are values |
shareKey |
string | Yes | Share key |
curl -X POST "https://openapi.rogo.com.vn/api/v2.0/iot-core/share/control/<deviceId>" \ -H "x-header-apikey: $API_KEY" \ -H "content-type: application/json" \ -d '{"elementIds":[123,456],"command":[1,0,1,2],"shareKey":"string"}'| Status | Meaning |
|---|---|
| 201 | Device control command sent successfully. |
| 400 | Bad Request. |
Example answer
{ "success": true}