更新时间:2025-05-30 01:56:03下载pdf
请求方式 | API | 描述 |
---|---|---|
GET | /v1.0/osaas/locations | 获取位置列表 |
GET | /v1.0/osaas/locations/{location_id} | 获取位置详情 |
调用该接口获取位置列表
GET /v1.0/osaas/locations
参数名 | 类型 | 参数类型 | 说明 | 是否必需 |
---|---|---|---|---|
parent_location_id | String | URL | 位置父级唯一标识,中国:0;获取国际地区:-1 | 是 |
参数名 | 类型 | 说明 |
---|---|---|
code | Integer | 响应码(详情见错误码章节),成功时为空 |
success | Boolean | 是否成功:(true:成功,false:失败) |
msg | String | 请求失败的信息,成功时为空 |
t | Long | 返回时间戳,13位 |
result | Array | 地理位置列表 |
result参数说明
参数名 | 类型 | 说明 |
---|---|---|
location_id | String | 位置唯一标识 |
name | String | 位置名称 |
parent_location_id | String | 父级唯一标识 |
level | Integer | 层级 |
GET {url}/v1.0/osaas/locations?parent_location_id=-1
{
"result": [
{
"location_id": "0",
"level": 0,
"name": "中国",
"parent_location_id": "-1"
}
],
"success": true,
"t": 1586229786371
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
调用该接口获取位置详情
GET /v1.0/osaas/locations/{location_id}
参数名 | 类型 | 参数类型 | 说明 | 是否必需 |
---|---|---|---|---|
location_id | String | URI | 位置唯一标识 | 是 |
参数名 | 类型 | 说明 |
---|---|---|
code | Integer | 响应码(详情见错误码章节),成功时为空 |
success | Boolean | 是否成功:(true:成功,false:失败) |
msg | String | 请求失败的信息,成功时为空 |
t | Long | 返回时间戳,13位 |
result | Object | 返回结果 |
result参数说明
参数名 | 类型 | 说明 |
---|---|---|
location_id | String | 位置唯一标识 |
name | String | 位置名称 |
parent_location_id | String | 父级唯一标识 |
level | Integer | 层级 |
GET {url}/v1.0/osaas/locations/11
{
"success": true,
"t": 1566053034624,
"result": {
"level": 1,
"name": "北京市",
"location_id": "11",
"parent_location_id": "0"
}
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
以下为该接口常见的业务异常,更多的异常错误,请参见全局错误码。
错误码 | 说明 |
---|---|
500 | 系统错误 |
该内容对您有帮助吗?
是意见反馈该内容对您有帮助吗?
是意见反馈