Method: providers.trips.search
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HTTP 请求
POST https://fleetengine.googleapis.com/v1/{parent=providers/*}/trips:search
网址采用 gRPC 转码语法。
路径参数
参数 |
parent |
string
必需。必须采用 providers/{provider} 格式。提供方必须是 Google Cloud 项目的 ID(例如 sample-cloud-project ),进行此调用的服务账号所属的 Google Cloud 项目所属的项目。
|
请求正文
请求正文中包含结构如下的数据:
JSON 表示法 |
{
"header": {
object (RequestHeader )
},
"vehicleId": string,
"activeTripsOnly": boolean,
"pageSize": integer,
"pageToken": string,
"minimumStaleness": string
} |
字段 |
header |
object (RequestHeader )
标准 Fleet Engine 请求标头。
|
vehicleId |
string
与请求中的行程相关联的车辆。如果未指定,返回的行程将不包含:
currentRouteSegment
remainingWaypoints
remainingDistanceMeters
etaToFirstWaypoint
|
activeTripsOnly |
boolean
如果设置为 true,响应会包含影响司机路线的行程。
|
pageSize |
integer
如果未设置,服务器会决定要返回的结果数。
|
pageToken |
string
将此项设为之前在 SearchTripsResponse 中返回的值,以继续从之前的结果中继续操作。
|
minimumStaleness |
string (Duration format)
如果指定,则返回在时间 (current - minimumStaleness) 之后未更新的行程。 该时长以秒为单位,最多包含九个小数位,以“s ”结尾。示例:"3.5s" 。
|
响应正文
trip.search 响应消息。
如果成功,响应正文将包含结构如下的数据:
JSON 表示法 |
{
"trips": [
{
object (Trip )
}
],
"nextPageToken": string
} |
字段 |
trips[] |
object (Trip )
所请求车辆的行程列表。
|
nextPageToken |
string
在 SearchTripsRequest 中传递此令牌,以对列表结果进行分页。该 API 在每次调用时都会返回一个行程列表,如果没有更多结果,则行程列表为空。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eRetrieve all trips associated with a specific vehicle using a POST request.\u003c/p\u003e\n"],["\u003cp\u003eSpecify the provider and vehicle ID in the request to filter the trips.\u003c/p\u003e\n"],["\u003cp\u003eThe response includes trip details and a token for pagination to retrieve more results if available.\u003c/p\u003e\n"],["\u003cp\u003eOptionally, refine the search by specifying whether to include only active trips, limiting the number of results, and setting a minimum staleness for data retrieval.\u003c/p\u003e\n"]]],[],null,["# Method: providers.trips.search\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.SearchTripsResponse.SCHEMA_REPRESENTATION)\n\nGet all the trips for a specific vehicle.\n\n### HTTP request\n\n`POST https://fleetengine.googleapis.com/v1/{parent=providers/*}/trips:search`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` Required. Must be in the format `providers/{provider}`. The provider must be the Project ID (for example, `sample-cloud-project`) of the Google Cloud Project of which the service account making this call is a member. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"header\": { object (/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/RequestHeader) }, \"vehicleId\": string, \"activeTripsOnly\": boolean, \"pageSize\": integer, \"pageToken\": string, \"minimumStaleness\": string } ``` |\n\n| Fields ||\n|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `header` | `object (`[RequestHeader](/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/RequestHeader)`)` The standard Fleet Engine request header. |\n| `vehicleId` | `string` The vehicle associated with the trips in the request. If unspecified, the returned trips do not contain: - `currentRouteSegment` - `remainingWaypoints` - `remainingDistanceMeters` - `etaToFirstWaypoint` |\n| `activeTripsOnly` | `boolean` If set to true, the response includes Trips that influence a driver's route. |\n| `pageSize` | `integer` If not set, the server decides the number of results to return. |\n| `pageToken` | `string` Set this to a value previously returned in the `SearchTripsResponse` to continue from previous results. |\n| `minimumStaleness` | `string (`[Duration](https://protobuf.dev/reference/protobuf/google.protobuf/#duration)` format)` If specified, returns the trips that have not been updated after the time `(current - minimumStaleness)`. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `\"3.5s\"`. |\n\n### Response body\n\ntrips.search response message.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"trips\": [ { object (/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#Trip) } ], \"nextPageToken\": string } ``` |\n\n| Fields ||\n|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `trips[]` | `object (`[Trip](/maps/documentation/mobility/fleet-engine/reference/trips/rest/v1/providers.trips#Trip)`)` The list of trips for the requested vehicle. |\n| `nextPageToken` | `string` Pass this token in the SearchTripsRequest to page through list results. The API returns a trip list on each call, and when no more results remain the trip list is empty. |"]]