# 司机位置
# 简介
本接口根据订单ID,查询司机当前位置。在司机接单(102状态)及以后有效。
# 服务提供方
享道
# 接口URL
/openapi/driver/location
# 请求方式
GET
# 请求频次
轮询 (5s)
# 请求参数
参数名称 | 类型 | 必选 | 说明 |
---|---|---|---|
timestamp | long | 是 | 请求时间,Unix Timestamp单位毫秒 |
order_id | string | 是 | 享道订单ID |
oid | string | 是 | 合作方订单ID |
# 响应参数
参数名称 | 类型 | 必有 | 说明 |
---|---|---|---|
errCode | int | 是 | 服务响应状态,参见附录5 |
errMsg | string | 是 | 服务响应状态说明,参见附录3 |
content | object | 是 | |
content.status | int | 是 | 订单状态,参考附录6 |
content.lon | double | 是 | 司机实时位置经度 |
content.lat | double | 是 | 司机实时位置纬度 |
content.oid | string | 是 | 合作方订单ID |
content.order_id | string | 是 | 享道订单ID |
content.direction | double | 是 | 司机车头方向角度(0为正北,顺时针旋转) |
content.distance | long | 否 | 接送驾剩余里程,单位米 |
content.duration | long | 否 | 接送驾剩余时长,单位秒 |
# 请求示例
请求
curl --location --request POST 'https://open-sit.saicmobility.com/merchant/v1/openapi/driver/location' \
--header 'X-Sign: aab078dd08a60c2a2e72bbbdfca3c9f94ab40e13' \
--header 'X-SignAlgorithm: 1' \
--header 'X-Timestamp: 20201021113700' \
--header 'X-MerchantId: open_app_OqPcV19dBV1KoBHs' \
--header 'Content-Type: application/json' \
--data-raw '{"timestamp":1603216497167,"oid":"Tess30vs2v9ehceptscs15ingh63dhd4gamx","order_id":"U4b3x6n9w1bb71ee8f5da34d208e0fd8cfc0f0cdfc"}'
响应
{
"errCode": 10000,
"errMsg": "successful",
"content": {
"oid": "Tess9rsa6ruev1yb0e6sbqsk71izsgpefg9r",
"order_id": "U4b3w6n9w1aebf19eed8be4475aba807826cef8154",
"lon": 121.455704,
"lat": 31.249601,
"direction": 0,
"distance": 111,
"duration": 20
}
}