跳转到主要内容
Subscription
已弃用

路线更新

迁移指南

路线详情

迁移截止时间:2027 年第一季度

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

操作

旧版新版
routegetRoute
routeUpdatedByIdroute

通用 schema 变更

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

查询和订阅变更

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

顶层

在顶层,大多数字段移至 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)取代,后者提供更细粒度的信息,包括每个分段的起点和终点详情。

分段
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 订阅来订阅路线,以便在路线计算过程中实时接收更新。新的集成应改用 route 订阅。

参数

id· ID· required

字段

route· RouteAlternative
Recommended route.
alternatives· RouteAlternative
Available alternatives.
ev· RequestEv
EV specific data for a route request.
telemetry· JSON
Route telemetry data.
user· RequestUser· You will receive null values.
routeRequest· RequestRoute
Route request data.
app· RouteApp
Application who requested a route.
status· RouteStatus
Route status.
RouteStatus enum values
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.

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

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 日 · 更新日期: 2023 年 1 月 25 日

我们使用 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 政策顶部的日期表示其最近一次更新的时间。