Locations
Homes: the top level of a user’s devices.
Every call needs the project’s API key in x-header-apikey. See Authentication. Errors use the codes in Error codes.
Get user location by uuid
Section titled “Get user location by uuid”GET https://openapi.rogo.com.vn/api/v2.0/iot-core/location/{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/location/<userId>/<uuid>" \ -H "x-header-apikey: $API_KEY"| Status | Meaning |
|---|---|
| 200 |
Example answer
{ "uuid": "string", "label": "", "desc": "", "userId": "string", "coordinate": [ 105.8342, 21.0278 ]}Get all user location
Section titled “Get all user location”GET https://openapi.rogo.com.vn/api/v2.0/iot-core/location/{userId}| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
userId |
path | string | Yes |
curl -X GET "https://openapi.rogo.com.vn/api/v2.0/iot-core/location/<userId>" \ -H "x-header-apikey: $API_KEY"| Status | Meaning |
|---|---|
| 200 |
Example answer
[ { "uuid": "string", "label": "", "desc": "", "userId": "string", "coordinate": [ 105.8342, 21.0278 ] }]Add user location
Section titled “Add user location”POST https://openapi.rogo.com.vn/api/v2.0/iot-core/location/{userId}| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
userId |
path | string | Yes |
Body
| Field | Type | Required | Description |
|---|---|---|---|
label |
string | Yes | |
desc |
string | Yes | |
coordinate |
number[] | No | [longitude, latitude]. Omit it when the location has no place on the map yet. |
curl -X POST "https://openapi.rogo.com.vn/api/v2.0/iot-core/location/<userId>" \ -H "x-header-apikey: $API_KEY" \ -H "content-type: application/json" \ -d '{"label":"string","desc":"string","coordinate":[105.8342,21.0278]}'| Status | Meaning |
|---|---|
| 200 |
Example answer
{ "uuid": "string", "label": "", "desc": "", "userId": "string", "coordinate": [ 105.8342, 21.0278 ]}Update user location
Section titled “Update user location”PATCH https://openapi.rogo.com.vn/api/v2.0/iot-core/location/{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/location/<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 location
Section titled “Delete user location”DELETE https://openapi.rogo.com.vn/api/v2.0/iot-core/location/{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 DELETE "https://openapi.rogo.com.vn/api/v2.0/iot-core/location/<userId>" \ -H "x-header-apikey: $API_KEY" \ -H "content-type: application/json" \ -d '{"uuid":"string","label":"string","desc":"string"}'| Status | Meaning |
|---|---|
| 200 |