GET/v1/transfers/tracking/:reservationId/events/latest

获取最新接送跟踪事件

读取某个预订最后已知的车辆位置和行程状态。

分享
GET/v1/transfers/tracking/:reservationId/events/latest

API 控制台

试一试

向沙箱 API 发送真实请求并查看响应。

凭证

登录后即可从已保存的 API 密钥中选择,无需手动粘贴。

路径参数

1 个字段

预订 ID

创建预订时返回的预订标识符。在统一详情端点中,reservationId、confirmationNumber、searchId 三者只能发送其中一个。

查询参数

2 个字段

货币

返回金额所用的货币。若已存在报价或预订,必须与其保持一致。

语言

旧版语言字段。建议使用 LANG 或 Accept-Language 请求头。

cURL 请求

cURL
bash
curl -X GET 'https://api.sandbox.travelandz.com/v1/transfers/tracking/:reservationId/events/latest?currency=USD' \
  -H 'Authorization: Bearer YOUR_SECRET_KEY' \
  -H 'X-Travelandz-Id: YOUR_PUBLIC_KEY:YOUR_PROFILE_CODE'

请填写凭证以发送请求。

此请求需要来自上一次调用的标识符或令牌。请先运行前一个步骤,然后把它的值粘贴到这里。

响应

点击「试一试!」发送请求,响应将显示在此处。

读取某个预订最后已知的车辆位置和行程状态。

认证和请求头

请求头说明
AuthorizationBearer <secret_key>。密钥只能保存在服务器端,不能写入客户端日志。
X-Travelandz-Id<public_key>:<profile_code>,持久化的 profile code 格式为 dp_<12 位字母数字>
LANG推荐的语言请求头,也支持 Accept-Language
Content-Type带 JSON body 的请求使用 application/json

请求

此端点不接收请求体。reservationId 放在路径中。

请求参数结构

reservationId
string
Reservation identifier returned when the booking was created.

请求查询参数模式

currency
enum
EURUSDINRCHFJPYGBPAUDCADCNYSGDNZDMXN
Lowercase values are accepted and normalized. Defaults to USD on a new search and is inherited afterwards.
language
enum
en-USes-ESde-DEfr-FRpt-BRzh-CNit-IT
Legacy field. Prefer the LANG or Accept-Language header.

成功响应

在尚无跟踪信息时所有字段都会被省略,因此空对象也是有效的 200 响应。行程开始前缺少 location 不应视为错误。

响应体结构

location
object
locationlatitude
number
locationlongitude
number
status
string
Journey state, for example driver_departed_to_pickup.
timestamp
string
格式: ISO 8601
trackingId
string

响应示例

json
json
{
  "location": {
    "latitude": 40.7607634,
    "longitude": -73.971212
  },
  "status": "driver_departed_to_pickup",
  "timestamp": "2026-07-25T17:47:01.761854Z",
  "trackingId": "c90n51960f274447b29473fc0d995f6a"
}

错误

HTTP代码含义建议操作
400请求体、查询参数或路径无效,或包含未知属性。根据 message 数组修正请求。
400transfer_invalid_currency该货币不在支持列表中。使用受支持的货币。
400transfer_invalid_language请求的语言不受支持。使用文档中列出的语言值之一。
429transfer_provider_error服务暂时被限流。使用指数退避重试。
502transfer_provider_error请求无法完成。不要假定成功。保留标识符,并在该操作可能已创建时查询预订。

使用说明

跟踪不会进行货币换算,currency 仅用于校验。旅客查看实时地图时,请使用流式端点。

cURL 示例

bash
bash
curl --request GET \
  --url "https://api.sandbox.travelandz.com/v1/transfers/tracking/f390daff1fdf4cccb19b7abd825dc011/events/latest?currency=USD" \
  -H "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
  -H "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE"