跳转到主要内容
Subscription
已弃用

按 ID 更新的路线

迁移指南

路线详情

迁移截止期:2027 年第一季度

从旧版 Route 服务迁移到最新版本。新服务提供重新组织的 schema、按国家/地区设置的运营商偏好、更快的路线计算以及更好的可维护性。

操作

旧新
routegetRoute
routeUpdatedByIdroute

通用 schema 变更

  • 显式类型:之前灵活的 JSON 字段现在已在 schema 中显式定义类型,以改进结构和验证。
  • 命名约定:字段现在使用 snake_case 而不是 camelCase。
  • 单位支持:数值输入现在支持不同的单位类型,以包含 value、type 和可选 source(manual、telemetry 或 default)的对象表示。

查询和 subscription 变更

字段命名和分组已修订,冗余字段已被移除。响应现在包含补全了默认值的原始输入,因此可以在以后重新计算路线时复用。

顶层

在顶层,大多数字段移至 recommended 下,ev、telemetry 和 routeRequest 输入合并为单个 request_input 对象。

字段移至
routerecommended
alternatives已移除
evrequest_input
telemetryrequest_input
routeRequestrequest_input
appmeta.app_id
status不变

路线

在路线层级,大多数字段移至 recommended 下并保持各自的名称,另有一些显式重命名。

字段移至
rangeStart*range_at_origin
rangeEnd*range_at_destination
chargesrecommended.charges
distancerecommended.distance
consumptionrecommended.consumption
chargeTimerecommended.durations.charging
polylinerecommended.polyline
pathPlotrecommended.path_plot
legsrecommended.legs
tagsrecommended.tags
instructions已移除
amenityRanking已移除
stationsAlongRouterecommended.alternative_stations

路段

在路段层级,续航范围遵循与路线相同的重命名,乘员和货物详情则移至每个路段的 origin 和 via 位置属性上。

字段移至
rangeStart*range_at_origin
rangeEnd*range_at_destination
stepssections
stationIdrecommended.legs.station.station_id

路段还新增了 range_after_charge 字段。

重点变更

响应还为路线分段引入了一种新的、结构更清晰的形式。下面将更详细地介绍。

分段

Steps 已被 sections 取代,后者提供更细粒度的信息,包括每个分段的起点和终点详情。

Sections
graphql
sections {  type  tags  polyline(decimals: five)  distance(unit: meter)  duration  consumption  origin {    id    type    properties {      occupants      total_occupant_weight      total_cargo_weight    }    geometry {      type      coordinates    }  }  destination {    id    type    properties {      occupants      total_occupant_weight      total_cargo_weight    }    geometry {      coordinates      type    }  }}

使用旧版 routeUpdatedById subscription 订阅路线,以在路线计算过程中接收实时更新。新的集成应改用 route subscription。

参数

id· ID · 必填

字段

telemetry· JSON
Route telemetry data.
status· RouteStatus
Route status.
RouteStatus 枚举值
pending

Route is queued and pending processing. Temporary status.

processing

We are computing the route for your request. Temporary status.

done

We finished computing the route, with a result. Final status.

not_found

We finished computing the route, without any result. Final status.

error

An error occurred while computing the route. Final status.

操作可能会失败。请考虑以下错误场景以正确处理。有关错误的更多信息 这里。

error_forbidden_message
You are forbidden to execute this operation.
operation_not_allowed
You are not allowed to execute this operation. Enable it for the current application in the dashboard or reach out to customer support.
rate_limit_exceeded
Rate limit exceeded.
route_polyline_invalid_decimals
Value for decimals number is not valid. Allowed values are 5 or 6.

此内容是否有帮助?

开发者

Chargetrip ©

管理 Cookie

生效日期:2024 年 3 月 20 日 · 更新日期:2026 年 9 月 1 日

我们使用 Cookie 来帮助改善您在 developers.chargetrip.com 上的体验。本Cookie 政策是隐私政策的一部分,涵盖您的设备与我们网站之间 Cookie 的使用。我们还提供了我们可能使用的第三方服务的基本信息,这些服务也可能在其服务中使用 Cookie,但不在我们的政策涵盖范围内。

如果您不希望接受我们的任何 Cookie,您应当设置浏览器拒绝来自 developers.chargetrip.com 的 Cookie,但请了解,我们可能因此无法向您提供某些您所需要的内容和服务。

Cookie 是网站在您访问时存储在您设备上的一小段数据,通常包含有关网站本身的信息、使网站在您再次访问时能够识别您的网络浏览器的唯一标识符、服务于该 Cookie 目的的其他数据,以及该 Cookie 本身的有效期。

Cookie 用于启用某些功能(例如登录)、跟踪网站使用情况(例如分析)、存储您的用户设置(例如时区、通知偏好),以及个性化您的内容(例如广告、语言)。

由您正在访问的网站设置的 Cookie 通常称为“第一方 Cookie”,通常只跟踪您在该特定网站上的活动。由其他网站和公司(即第三方)设置的 Cookie 可用于在使用相同第三方服务的其他网站上跟踪您。

由您正在访问的网站设置的 Cookie 通常称为“第一方 Cookie”,通常只跟踪您在该特定网站上的活动。由其他网站和公司(即第三方)设置的 Cookie 可用于在使用相同第三方服务的其他网站上跟踪您。

定向/广告 Cookie 用于确定哪些推广内容与您及您的兴趣更相关、更合适。网站可能使用它们来投放定向广告,或限制您看到某则广告的次数。这有助于公司提高其营销活动的效果以及呈现给您的内容的质量。这些 Cookie 可能由您正在访问的网站(第一方)或第三方服务设置。由第三方设置的定向/广告 Cookie 可用于在使用相同第三方服务的其他网站上跟踪您。我们在网站上使用定向/广告 Cookie。

定向/广告 Cookie 用于确定哪些推广内容与您及您的兴趣更相关、更合适。网站可能使用它们来投放定向广告,或限制您看到某则广告的次数。这有助于公司提高其营销活动的效果以及呈现给您的内容的质量。这些 Cookie 可能由您正在访问的网站(第一方)或第三方服务设置。由第三方设置的定向/广告 Cookie 可用于在使用相同第三方服务的其他网站上跟踪您。我们在网站上使用定向/广告 Cookie。

第三方承诺

在启用所有第三方提供商的服务之前,我们会审查其隐私政策,以确保其做法与我们一致。我们绝不会明知故犯地引入损害或违反用户隐私的第三方服务。

Cookie
google-cookie-consent
描述
存储您的 Cookie 偏好,即您接受或拒绝了哪些类别,以便我们在您每次访问时都尊重您的选择,并且只加载您允许的分析或营销工具。
有效期
2 年

如果您不希望接受我们的 Cookie,您可以设置浏览器拒绝来自我们网站的 Cookie。大多数浏览器默认配置为接受 Cookie,但您可以更改这些设置,以完全拒绝 Cookie,或在网站尝试设置 Cookie 时通知您。

如果您使用多台设备浏览网站,可能需要在每台设备上分别更新设置。

虽然阻止某些 Cookie 对网站体验的影响很小,但阻止所有 Cookie 可能意味着您无法访问所浏览网站上的某些功能和内容。

我们可能会不时更新本 Cookie 政策,例如反映我们所使用 Cookie 的变化,或出于其他运营、法律或监管原因。请定期重新查看本 Cookie 政策,以了解我们对 Cookie 及相关技术的使用情况。本 Cookie 政策顶部的日期表示其最近一次更新的时间。