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 )。
|
要求主體
要求主體的資料會採用以下結構:
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) 時間之後尚未更新的行程。 持續時間以秒為單位,最多 9 個小數位數,結尾為「s 」。範例:"3.5s" 。
|
回應主體
route.search 回應訊息。
如果成功,回應主體會含有以下結構的資料:
JSON 表示法 |
{
"trips": [
{
object (Trip )
}
],
"nextPageToken": string
} |
欄位 |
trips[] |
object (Trip )
要求車輛的行程清單。
|
nextPageToken |
string
在 SearchTripsRequest 中將此憑證傳遞到清單結果頁面。API 會在每次呼叫傳回行程清單,當行程清單未繼續時,就會傳回空白清單。
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-31 (世界標準時間)。
[null,null,["上次更新時間: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. |"]]