Last Updated on : 2025-05-30 01:56:03download
| Request method | API | Description |
|---|---|---|
| GET | /v1.0/osaas/locations | API for Obtaining the Geographic Location List |
| GET | /v1.0/osaas/locations/{location_id} | API for Obtaining Geographic Location Details |
You can use this API to obtain the geographic location list of the lower level.
GET /v1.0/osaas/locations
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| parent_location_id | String | URL | Unique ID of the parent geographic location. 0: China -1: international | Yes |
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response code.Null indicates success. |
| success | Boolean | Request result. true: success false: failure |
| msg | String | Exception message.It is null when the request result is success. |
| t | Long | Response time, which is a 13-digit timestamp. |
| result | Array | Geographic location set. |
Parameters in result
| Parameter | Type | Description |
|---|---|---|
| location_id | String | Unique ID of a geographic location. |
| name | String | Name of a geographic location |
| parent_location_id | String | Unique ID of the parent geographic location |
| level | Integer | Level of a geographic location. |
GET {url}/v1.0/osaas/locations?parent_location_id=-1
{
"result": [
{
"location_id": "0",
"level": 0,
"name": "China",
"parent_location_id": "-1"
}
],
"success": true,
"t": 1586229786371
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
You can use this API to obtain geographic location details based on the unique ID of a geographic location.
GET /v1.0/osaas/locations/{location_id}
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| location_id | String | URI | Unique ID of a geographic location. | Yes |
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response code.Null indicates success. |
| success | Boolean | Request result. true: success false: failure |
| msg | String | Exception message.It is null when the request result is success. |
| t | Long | Response time, which is a 13-digit timestamp. |
| result | Object | Details about a geographic location. |
Parameters in result
| Parameter | Type | Description |
|---|---|---|
| location_id | String | Unique ID of a geographic location. |
| name | String | Name of a geographic location |
| parent_location_id | String | Unique ID of the parent geographic location |
| level | Integer | Level of a geographic location. |
GET {url}/v1.0/osaas/locations/11
{
"success": true,
"t": 1566053034624,
"result": {
"location_id": "0",
"level": 0,
"name": "China",
"parent_location_id": "-1"
}
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
The following are common business exceptions for this interface. For more exception errors, see Global Error Codes.
| error code | explain |
|---|---|
| 500 | system error |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback