跳转到主要内容
Mutation
已弃用

创建路线

迁移指南

创建路线

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

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

操作

旧版新版
newRoutecreateRoute

通用 schema 变更

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

Mutation 变更

createRoute 上的 input 参数已被重新组织并简化。

routeRequest

在根层级,以下字段已被移除。与运营商相关的字段现在由运营商偏好涵盖,与设施相关的字段已移至其专用的设施查询。

字段移至
operatorIds已移除
amenities已移除
amenity_preferences已移除
operatorRequired已移除
operatorPrefer已移除

EV

在 EV 层级,大多数顶层字段已移入专用的 vehicle 对象。

字段移至
ev.idvehicle.id
batteryvehicle
climatevehicle
heat_pumpvehicle
plugsvehicle.charging.connectors
safeRiskMarginvehicle.charging.risk_margin
chargeModevehicle.charging.mode
bmsConsumption已移除

车辆负载

车辆负载属性不再在单一位置设置。现在它们按每个 origin 和 via 点分别指定,从而可以按路段更精细地控制乘员和载货重量。它们位于每个位置的 properties.vehicle 下,字段名称变更如下:

字段移至
occupants不变
cargototal_cargo_weight

遥测

以下遥测数据已从根层级移入 vehicle 对象。

字段移至
headingvehicle
motor_rpmvehicle
odometervehicle
outside_temperaturevehicle
tire_pressurevehicle
vehicle_speedvehicle

重点变更

input 参数上的一些字段现在具有新的、结构更清晰的形态。下文将更详细地介绍。

运营商偏好

运营商偏好被简化为三个级别:high、medium 和 low。每个条目(无论是排名、排除还是避开)都可以通过 countries 字段限定到特定国家。如果省略,则会考虑所有国家。

运营商偏好
graphql
input: {  operators: {    ranking: {      type: preferred      levels: {        high: [          {            id: "op1"            countries: [NL]          }        ]        low: [          {            id: "op3"          }        ]      }    }  }}

乘员总重量

新的 total_occupant_weight 字段允许您覆盖默认的乘员重量,使用新的单位对象表示。

乘员总重量
graphql
input: {  origin: {    properties: {      vehicle: {        occupants: 3        total_occupant_weight: {          value: 160          type: kilogram          source: manual        }      }    }  }}

使用旧版 newRoute 变更创建新路线。在您迁移到 createRoute 变更期间,该变更仍然可用;createRoute 变更采用重新组织的架构和按国家设置的运营商偏好,用于计算充电停靠点、能耗和行驶时间。

参数

input· RequestInput

字段

ID· ID· In favor of createRoute.

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

consumption_exceeded
Provided consumption value for $LOCATION is not valid. The value must be between 0 and $MAXVALUE kwh, or the equivalent in another unit, for this vehicle.
empty_array_not_allowed
Array $NAME should have at least one value.
error_forbidden_message
You are forbidden to execute this operation.
invalid_coordinates
Coordinates provided for $LOCATION are not valid.
invalid_unit
Provided unit type $TYPE for $LOCATION is not valid.
invalid_value
Provided value $VALUE for $LOCATION is not valid. Expected value of type $EXPECTEDTYPE.
negative_value_not_allowed
Negative value for $LOCATION is not allowed.
occupants_above_allowed
Provided number of occupants for $LOCATION is not valid. The value must be less than or equal to $OCCUPANTSCOUNT for this vehicle.
occupants_below_allowed
Provided number of occupants for $LOCATION is not valid. The value must be at least 1.
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.
operator_both_excluded_and_ranking
Operator $OPERATORID is both in the ranking and excluded lists.
operator_duplicated_in_exclude
Operator $OPERATORID is multiple times in the exclude lists.
operator_duplicated_in_ranking
Operator $OPERATORID is multiple times in the ranking lists.
operator_invalid_ranking
Operator ranking must be between 1 and 10.
operator_not_found
No operator was found with the $OPERATORID ID.
operator_ranking_none_given
The route operator type was set to $ROUTEOPTYPE, but no ranking was provided. Please add an operator to your client or route request.
rate_limit_exceeded
Rate limit exceeded.
route_battery_capacity_above_allowed
The provided battery capacity is too high. The value must be less than or equal to $MAX kwh or the equivalent in another unit.
route_battery_capacity_below_allowed
The provided battery capacity is too small. The value must be greater than or equal to $MIN kwh or the equivalent in another unit.
route_cargo_below_allowed
Provided amount of cargo weight is not valid. The value cannot be negative.
route_consumption_invalid_worst
Provided consumption value for $NAME is not valid. The worst value must be greater than or equal to best value.
route_consumption_total_exceeded
Provided consumption values are not valid. The total must be between 0 and $MAXVALUE for this vehicle.
route_destination_station_and_external_station_not_matching
The destination station for the route requested was not matched with the external station.
route_destination_station_invalid_speed
The provided destination station $STATIONID cannot be used as charging stop. The station does not support DC charging (> 43kW).
route_destination_station_not_found
The destination station for the route requested was not found with the provided ID.
route_destination_station_out_of_service
The provided destination station $STATIONID cannot be used as charging stop. All compatible connectors at this station are out of service.
route_duplicate_amenities
Amenities $DUPLICATEDAMENITIES are duplicated.
route_final_soc_exceeding_battery_capacity
The provided final state of charge is too high. The value must be less than or equal to 80% of the vehicle battery capacity.
route_invalid_amenities
Amenities $INVALIDAMENITIES are not valid. Allowed: $ALLOWEDAMENITIES.
route_invalid_destination_coordinates
The destination coordinates provided are not valid.
route_invalid_origin_coordinates
The origin coordinates provided are not valid.
route_invalid_scheduled_charge_stop_duration
The scheduled charge stop duration is invalid. The value must be between 900 and 86400 seconds.
route_invalid_scheduled_charge_stop_max_distance_from_station
The scheduled charge stop max_distance_from_station is invalid. The value must be between 0 and 1000 meters.
route_invalid_via_coordinates
The via coordinates provided are not valid.
route_max_number_of_passengers_exceeded
Provided number of passengers is not valid. The value must be between 1 and $PASSENGERCOUNT for this vehicle.
route_min_power_below_allowed
The provided minimum power is too small. The value must be greater than 0.
route_origin_station_and_external_station_not_matching
The origin station for the route requested was not matched with the external station.
route_origin_station_not_found
The origin station for the route requested was not found with the provided ID.
route_radius_above_allowed
The radius value is above allowed, the maximum value is 5000 meters.
route_radius_below_allowed
The radius value is below allowed, the minimum value is 500 meters.
route_station_invalid_charger
The provided via station $STATIONID cannot be used as charging stop. The charger standard of the vehicle is not supported.
route_station_invalid_min_power
The minimum power requested is higher than the station could support.
route_station_invalid_speed
The provided via station $STATIONID cannot be used as charging stop. The station does not support DC charging (> 43kW).
route_station_out_of_service
The provided via station $STATIONID cannot be used as charging stop. All compatible connectors at this station are out of service.
route_via_cargo_below_allowed
Provided amount of cargo is not valid. The value must be greater than 0.
route_via_station_and_external_station_not_matching
The via station for the route requested was not matched with the external station.
route_via_station_not_found
The station ID used as a via for the requested route was not found.
soc_exceeding_battery_capacity
The provided state of charge for $LOCATION is too high. The value must be less than or equal to the vehicle battery capacity.
station_destination_coordinates_not_matching
Coordinates [$DESTINATIONCOORDINATES] of destination don't match with station coordinates [$STATIONCOORDINATES].
station_origin_coordinates_not_matching
Coordinates [$ORIGINCOORDINATES] of origin don't match with station coordinates [$STATIONCOORDINATES].
station_via_coordinates_not_matching
Coordinates [$VIACOORDINATES] of via don't match with station coordinates [$STATIONCOORDINATES].
tire_pressure_below_allowed
Provided tire pressure is not valid. The value must be at least 1.
vehicle_freemium_not_allowed
You do not have access to this vehicle. Please upgrade to access this vehicle.
vehicle_type_not_allowed
Vehicle of type $TYPE is not allowed for this operation.
zero_or_negative_value_not_allowed
Zero or negative value for $LOCATION is not allowed.

此内容是否有帮助?

开发者

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