تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يوضّح هذا المستند كيفية إدراج مركبات التسليم.
البيئات والقيود
يمكنك إدراج مركبات التسليم من بيئة خادم أو متصفّح. لا يتيح Driver SDK عرض المركبات المخصّصة للتوصيل.
يتطلّب إدراج مركبات التوصيل إذن وصول واسع النطاق إلى مركبات التوصيل، وهو مخصّص للمستخدمين الموثوق بهم فقط. استخدِم الرموز المميزة Delivery Fleet Reader أو Fleet Engine
Delivery Admin عند تقديم طلبات لعرض قائمة بمركبات التوصيل.
تم إخفاء الحقول التالية في مركبات التوصيل المدرَجة بسبب تأثيرها في حجم الردّ:
CurrentRouteSegment
RemainingVehicleJourneySegments
الاستخدام
يمكنك إدراج المركبات حسب فلاتر السمات وحدود إطار العرض. في حال عدم تحديد أي فلتر أو إطار عرض، سيتضمّن الرد جميع وسائل النقل.
قائمة تتضمّن فلاتر السمات
يمكنك إدراج مركبات التوصيل حسب الفلتر باستخدام السمة attributes. على سبيل المثال، للاستعلام عن سمة ذات مفتاح my_key وقيمة my_value، استخدِم attributes.my_key = my_value. للبحث عن سمات متعددة، ادمج طلبات البحث باستخدام المعاملَين المنطقيَين AND وOR كما في attributes.key1 = value1 AND
attributes.key2 = value2. راجِع AIP-160 للحصول على وصف كامل
لبنية طلب البحث الخاص بالفلتر. في حال الجمع بين الفلاتر وحدود إطار العرض، يعمل الفلتر كعامل تشغيل AND لحدود إطار العرض. لمزيد من التفاصيل، يُرجى الاطّلاع على طلبات البحث التي تستخدم فلتر سمات المركبات.
قائمة تتضمّن حدود إطار العرض
يمكنك فلترة مركبات التوصيل المُدرَجة حسب الموقع الجغرافي باستخدام مَعلمة طلب viewport. تحدّد مَعلمة الطلب viewport منافذ العرض باستخدام إحداثيَين حدوديَّين: high (الشمال الشرقي) وlow (الجنوب الغربي) لزوج إحداثيات خط العرض وخط الطول. يتم رفض الطلبات إذا كانت تتضمّن خط عرض مرتفعًا
أقل جغرافيًا من خط عرض منخفض.
عرض الردود
يتم تقسيم قوائم مركبات التوصيل إلى صفحات تلقائيًا باستخدام حجم صفحة معقول. في حال تحديد حجم الصفحة، لن يعرض الطلب سوى عدد المركبات الذي يحدّده الحدّ الأقصى، أو أقل. إذا تجاوز حجم الصفحة المطلوب الحدّ الأقصى الداخلي، يتم استخدام الحدّ الأقصى الداخلي. يبلغ حجم الصفحة التلقائي والأقصى 100 مركبة.
يمكن أن تتضمّن قائمة مركبات التوصيل رمزًا مميزًا لقراءة الصفحة التالية من النتائج. لا يتوفّر رمز مميّز للصفحة في الرد إلا عندما تتوفّر صفحات إضافية من مركبات التوصيل يمكن استرجاعها. لاسترداد الصفحة التالية من المهام، استخدِم رمز الصفحة مع طلب مطابق للطلب السابق.
أمثلة على بيانات المركبات
يمكنك استخدام مكتبة Java gRPC أو REST لعرض قائمة بمركبات التوصيل في منطقة معيّنة تتضمّن سمة معيّنة. قد تظل الاستجابة الناجحة فارغة. في هذه الحالة، يعني ذلك أنّه لا تتوفّر أي مركبات تتضمّن السمة المحدّدة
في إطار العرض المحدّد.
Java
staticfinalStringPROJECT_ID="my-delivery-co-gcp-project";DeliveryServiceBlockingStubdeliveryService=DeliveryServiceGrpc.newBlockingStub(channel);// Tasks requestStringparent="providers/"+PROJECT_ID;ListDeliveryVehiclesRequestlistDeliveryVehiclesRequest=ListDeliveryVehiclesRequest.newBuilder()// No need for the header.setParent(parent).setViewport(Viewport.newBuilder().setHigh(LatLng.newBuilder().setLatitude(37.45).setLongitude(-122.06).build()).setLow(LatLng.newBuilder().setLatitude(37.41).setLongitude(-122.11).build()).setFilter("attributes.my_key = my_value").build();try{ListDeliveryVehiclesResponselistDeliveryVehiclesResponse=deliveryService.listDeliveryVehicles(listDeliveryVehiclesRequest);}catch(StatusRuntimeExceptione){Statuss=e.getStatus();switch(s.getCode()){caseNOT_FOUND:break;casePERMISSION_DENIED:break;}return;}
# Request with a filter# Request sets JWT, PROJECT_ID, and VEHICLE_ID in the local environmentcurl-H"Authorization: Bearer ${JWT}"\
"https://fleetengine.googleapis.com/v1/providers/${PROJECT_ID}/deliveryVehicles?filter=attributes.my_key%20%3D%20my_value%20&viewport.high.latitude=37.45&viewport.high.longitude=-122.06&viewport.low.latitude=37.41&viewport.low.longitude=-122.11"
إذا كانت عملية البحث ناجحة، سيحتوي نص الاستجابة على بيانات بالبنية التالية:
تاريخ التعديل الأخير: 2025-09-05 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-09-05 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eThis guide explains how to retrieve a list of delivery vehicles, including filtering by attributes and location.\u003c/p\u003e\n"],["\u003cp\u003eYou can list vehicles using attribute filters and viewport bounds, enabling targeted retrieval.\u003c/p\u003e\n"],["\u003cp\u003eList responses are paginated, allowing for the retrieval of large datasets in manageable chunks.\u003c/p\u003e\n"],["\u003cp\u003eExamples are provided for listing vehicles using both the Java gRPC library and REST API.\u003c/p\u003e\n"],["\u003cp\u003eAccess to delivery vehicle listing requires specific authorization using \u003cem\u003eDelivery Fleet Reader\u003c/em\u003e or \u003cem\u003eFleet Engine Delivery Admin\u003c/em\u003e tokens.\u003c/p\u003e\n"]]],[],null,["# List delivery vehicles\n\n| **Note:** **Before constructing a vehicle request** , read the requirements under [Vehicle requests](/maps/documentation/mobility/fleet-engine/essentials/vehicles#vehicle_requests) in the Introduction.\n\nThis document describes how to list delivery vehicles.\n\nEnvironments and limitations\n----------------------------\n\nYou can list delivery vehicles from a server or browser environment. The Driver\nSDK does not support listing delivery vehicles.\n\nListing delivery vehicles requests broad access to delivery vehicles and is\nintended only for trusted users. Use *Delivery Fleet Reader* or *Fleet Engine\nDelivery Admin* tokens when making list delivery vehicles requests.\n\nListed delivery vehicles have the following fields redacted due to their impact\non response size:\n\n- `CurrentRouteSegment`\n- `RemainingVehicleJourneySegments`\n\nUsage\n-----\n\nYou can list vehicles by attribute filters and viewport bounds. If you specify\nno filter or viewport, the response includes all delivery vehicles.\n\n### List with attributes filters\n\nYou can list delivery vehicles by filter using their `attributes` property. For\nexample, to query an attribute with key `my_key` and value `my_value`, use\n`attributes.my_key = my_value`. To query for multiple attributes, join queries\nusing the logical `AND` and `OR` operators as in `attributes.key1 = value1 AND\nattributes.key2 = value2`. See [AIP-160](https://google.aip.dev/160) for a full description\nof filter query syntax. If you combine filters with viewport bounds, the filter\nacts as an `AND` operator to the viewport bound. See [Vehicle attributes filter\nqueries](/maps/documentation/mobility/fleet-engine/essentials/vehicles/scheduled-tasks-vehicle-fields) for details.\n\n### List with viewport bounds\n\nYou can filter listed delivery vehicles by location using the `viewport` request\nparameter. The `viewport` request parameter defines viewports using two bounding\ncoordinates: a `high` (northeast) and `low` (southwest) latitude and longitude\ncoordinates pair. Requests are rejected if they contain a high latitude\nthat is geographically lower than a low latitude.\n\n### List responses\n\nDelivery vehicle lists are paginated by default using a reasonable page size. If\nyou specify a page size, the request returns only the number of vehicles\nspecified by the limit, or fewer. If the requested page size exceeds an internal\nmaximum value, then the internal maximum is used. The default and maximum page\nsizes are both 100 vehicles.\n\nA delivery vehicles list can include a token for reading the next page of\nresults. A page token is only present in a response when more pages of delivery\nvehicles are available for retrieval. To retrieve the next page of tasks, use\nthe page token with a request that is otherwise identical to the previous\nrequest.\n\nList vehicles examples\n----------------------\n\nYou can use the [Java gRPC library](/maps/documentation/mobility/fleet-engine/essentials/client-libraries-tasks#java) or REST to list delivery vehicles in a\nparticular region with a certain attribute. A successful response can still be\nempty. When that happens, it means that no vehicles with the specified attribute\nexist in the specified viewport. \n\n### Java\n\n\n static final String PROJECT_ID = \"my-delivery-co-gcp-project\";\n\n DeliveryServiceBlockingStub deliveryService =\n DeliveryServiceGrpc.newBlockingStub(channel);\n\n // Tasks request\n String parent = \"providers/\" + PROJECT_ID;\n ListDeliveryVehiclesRequest listDeliveryVehiclesRequest =\n ListDeliveryVehiclesRequest.newBuilder() // No need for the header\n .setParent(parent)\n .setViewport(\n Viewport.newBuilder()\n .setHigh(LatLng.newBuilder()\n .setLatitude(37.45)\n .setLongitude(-122.06)\n .build())\n .setLow(LatLng.newBuilder()\n .setLatitude(37.41)\n .setLongitude(-122.11)\n .build())\n .setFilter(\"attributes.my_key = my_value\")\n .build();\n\n try {\n ListDeliveryVehiclesResponse listDeliveryVehiclesResponse =\n deliveryService.listDeliveryVehicles(listDeliveryVehiclesRequest);\n } catch (StatusRuntimeException e) {\n Status s = e.getStatus();\n switch (s.getCode()) {\n case NOT_FOUND:\n break;\n\n case PERMISSION_DENIED:\n break;\n }\n return;\n }\n\n### REST\n\n # HTTP request\n html GET https://fleetengine.googleapis.com/v1/providers/\u003cproject_id\u003e/deliveryVehicles\n\n\n # Request with a filter\n # Request sets JWT, PROJECT_ID, and VEHICLE_ID in the local environment\n curl -H \"Authorization: Bearer ${JWT}\" \\\n \"https://fleetengine.googleapis.com/v1/providers/${PROJECT_ID}/deliveryVehicles?filter=attributes.my_key%20%3D%20my_value%20&viewport.high.latitude=37.45&viewport.high.longitude=-122.06&viewport.low.latitude=37.41&viewport.low.longitude=-122.11\"\n\nIf the lookup is successful, the response body contains data with the following\nstructure: \n\n // JSON representation\n {\n \"deliveryVehicles\": [\n {\n object (DeliveryVehicle)\n }\n ],\n \"nextPageToken\": string,\n \"totalSize\": integer\n }\n\nWhat's next\n-----------\n\n- [Delete Delivery Vehicle](/maps/documentation/mobility/fleet-engine/essentials/vehicles/scheduled-tasks-delete-vehicle)"]]