Method: providers.trips.search
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
รับข้อมูลการเดินทางทั้งหมดของยานพาหนะหนึ่งๆ
คำขอ HTTP
POST https://fleetengine.googleapis.com/v1/{parent=providers/*}/trips:search
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
parent |
string
ต้องระบุ ต้องอยู่ในรูปแบบ providers/{provider} ผู้ให้บริการต้องเป็นรหัสโปรเจ็กต์ (เช่น 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
หากตั้งค่าเป็น "จริง" การตอบกลับจะรวมการเดินทางที่มีอิทธิพลต่อเส้นทางของผู้ขับ
|
pageSize |
integer
หากไม่ได้ตั้งค่า เซิร์ฟเวอร์จะกำหนดจำนวนผลลัพธ์ที่จะแสดง
|
pageToken |
string
ตั้งค่านี้เป็นค่าที่แสดงผลก่อนหน้านี้ใน SearchTripsResponse เพื่อดำเนินการต่อจากผลลัพธ์ก่อนหน้า
|
minimumStaleness |
string (Duration format)
หากระบุไว้ ระบบจะแสดงผลการเดินทางที่ไม่มีการอัปเดตหลังจากเวลา (current - minimumStaleness) ระยะเวลาเป็นวินาทีโดยมีเลขเศษส่วนไม่เกิน 9 หลัก ลงท้ายด้วย "s " ตัวอย่างเช่น "3.5s"
|
เนื้อหาการตอบกลับ
ข้อความตอบกลับ Journey.search
หากทำสำเร็จ เนื้อหาการตอบกลับจะมีข้อมูลซึ่งมีโครงสร้างดังต่อไปนี้
การแสดง JSON |
{
"trips": [
{
object (Trip )
}
],
"nextPageToken": string
} |
ช่อง |
trips[] |
object (Trip )
รายการการเดินทางสำหรับยานพาหนะที่ขอ
|
nextPageToken |
string
ส่งโทเค็นนี้ในหน้า SearchTripsRequest เพื่อแสดงรายการผลลัพธ์ API จะแสดงรายการการเดินทางในการโทรแต่ละครั้ง และเมื่อไม่มีผลลัพธ์เพิ่มเติมในรายการการเดินทางจะว่างเปล่า
|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 2025-08-31 UTC"],[[["\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. |"]]