Skip to content

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.

POST https://openapi.rogo.com.vn/api/v2.0/iot-core/share/entity/add

Body

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
Terminal window
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": {}
}
DELETE https://openapi.rogo.com.vn/api/v2.0/iot-core/share/entity/delete

Body

Field Type Required Description
uuid string No
Terminal window
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 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
Terminal window
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 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
Terminal window
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 https://openapi.rogo.com.vn/api/v2.0/iot-core/share/entity/getbyowner/{userId}
Parameter In Type Required Description
userId path string Yes
Terminal window
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 https://openapi.rogo.com.vn/api/v2.0/iot-core/share/entity/getbyshared/{userId}
Parameter In Type Required Description
userId path string Yes
Terminal window
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
DELETE https://openapi.rogo.com.vn/api/v2.0/iot-core/share/access/delete

Body

Field Type Required Description
uuid string No
Terminal window
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 https://openapi.rogo.com.vn/api/v2.0/iot-core/share/access/getbyowner/{userId}
Parameter In Type Required Description
userId path string Yes
Terminal window
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 https://openapi.rogo.com.vn/api/v2.0/iot-core/share/access/getbyshared/{userId}
Parameter In Type Required Description
userId path string Yes
Terminal window
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 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
Terminal window
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 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
Terminal window
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"
}
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
Terminal window
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
}