Method: hashLists.batchGet
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
الحصول على قوائم علامات هاشتاغ متعددة في آنٍ واحد
من الشائع جدًا أن يحتاج العميل إلى الحصول على قوائم علامات هاشتاغ متعددة. ويُفضَّل استخدام هذه الطريقة بدلاً من استخدام طريقة Get العادية عدة مرات.
هذه طريقة Get مجمّعة عادية كما هو محدّد في https://google.aip.dev/231، وطريقة HTTP هي GET أيضًا.
طلب HTTP
GET https://safebrowsing.googleapis.com/v5alpha1/hashLists:batchGet
يستخدِم عنوان URL بنية تحويل ترميز gRPC.
مَعلمات طلب البحث
المعلمات |
names[] |
string
مطلوب. أسماء قوائم التجزئة المحدّدة قد تكون القائمة قائمة بالتهديدات، أو قد تكون ذاكرة التخزين المؤقت الشاملة. يجب ألّا تحتوي الأسماء على نُسخ مكرّرة، وإلا سيظهر خطأ للعملاء.
|
version[] |
string (bytes format)
إصدارات قائمة التجزئة التي يمتلكها العميل إذا كانت هذه هي المرة الأولى التي يحصل فيها العميل على قوائم التجزئة، يجب ترك الحقل فارغًا. بخلاف ذلك، على العميل تقديم الإصدارات التي تم استلامها سابقًا من الخادم. يجب ألّا يغيّر العميل هذه البايتات. ولا يحتاج العميل إلى إرسال الإصدارات بالترتيب نفسه لاسمَي القوائم المعنيّين. قد يرسل العميل عددًا أقل أو أكثر من النُسخ في طلب معيّن مقارنةً بعدد الأسماء. ومع ذلك، يجب ألا يرسل العميل نُسخًا متعددة تتطابق مع الاسم نفسه، وإذا فعل ذلك، سيتلقّى العميل رسالة خطأ. ملاحظة تاريخية: في الإصدار 4 من واجهة برمجة التطبيقات، كان هذا الحقل يُعرف باسم states ، وتمّت إعادة تسميته الآن إلى version من أجل الوضوح. سلسلة بترميز base64
|
sizeConstraints |
object (SizeConstraints )
قيود الحجم المفروضة على كل قائمة في حال حذفها، لن يتم فرض أي قيود. يُرجى العلم أنّ الأحجام هنا معروضة لكل قائمة، وليس مجمّعة على مستوى جميع القوائم.
|
نص الطلب
يجب أن يكون نص الطلب فارغًا.
نص الاستجابة
الاستجابة التي تحتوي على قوائم علامات هاشتاغ متعددة
إذا كانت الاستجابة ناجحة، سيحتوي نص الاستجابة على بيانات بالبنية التالية:
تمثيل JSON |
{
"hashLists": [
{
object (HashList )
}
]
} |
الحقول |
hashLists[] |
object (HashList )
يتم إدراج التجزئات بالترتيب نفسه الوارد في الطلب.
|
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eBatch retrieve multiple hash lists efficiently, rather than using individual Get requests.\u003c/p\u003e\n"],["\u003cp\u003eSpecify desired hash lists by name, versions (if previously fetched), desired hash prefix length, and optionally, size constraints.\u003c/p\u003e\n"],["\u003cp\u003eReceive a response containing the requested hash lists in the specified order.\u003c/p\u003e\n"],["\u003cp\u003eThis method adheres to the standard batch Get method as defined by Google AIP and uses the GET HTTP method.\u003c/p\u003e\n"],["\u003cp\u003eRequest body should be empty for this operation.\u003c/p\u003e\n"]]],["This document details the `batchGet` method for retrieving multiple hash lists via a `GET` HTTP request to `safebrowsing.googleapis.com/v5alpha1/hashLists:batchGet`. Required parameters include `names[]` for specifying hash lists and `version[]` for indicating existing versions. `desiredHashLength` defines the desired hash prefix length, and `sizeConstraints` limits list sizes. The request body is empty, and the response contains an array `hashLists[]`, ordered as requested.\n"],null,["# Method: hashLists.batchGet\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.BatchGetHashListsResponse.SCHEMA_REPRESENTATION)\n\nGet multiple hash lists at once.\n\nIt is very common for a client to need to get multiple hash lists. Using this method is preferred over using the regular Get method multiple times.\n\nThis is a standard batch Get method as defined by \u003chttps://google.aip.dev/231\u003e and the HTTP method is also GET.\n\n### HTTP request\n\n`GET https://safebrowsing.googleapis.com/v5alpha1/hashLists:batchGet`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `names[]` | `string` Required. The names of the particular hash lists. The list MAY be a threat list, or it may be the Global Cache. The names MUST NOT contain duplicates; if they did, the client will get an error. |\n| `version[]` | `string (`[bytes](https://developers.google.com/discovery/v1/type-format)` format)` The versions of the hash list that the client already has. If this is the first time the client is fetching the hash lists, the field should be left empty. Otherwise, the client should supply the versions previously received from the server. The client MUST NOT manipulate those bytes. The client need not send the versions in the same order as the corresponding list names. The client may send fewer or more versions in a request than there are names. However the client MUST NOT send multiple versions that correspond to the same name; if it did, the client will get an error. Historical note: in V4 of the API, this was called `states`; it is now renamed to `version` for clarity. A base64-encoded string. |\n| `sizeConstraints` | `object (`[SizeConstraints](/safe-browsing/reference/rest/v5alpha1/SizeConstraints)`)` The size constraints on each list. If omitted, there are no constraints. Note that the sizes here are per-list, not aggregated across all lists. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nThe response containing multiple hash lists.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------|\n| ``` { \"hashLists\": [ { object (/safe-browsing/reference/rest/v5alpha1/hashList#HashList) } ] } ``` |\n\n| Fields ||\n|---------------|------------------------------------------------------------------------------------------------------------------------------------------|\n| `hashLists[]` | `object (`[HashList](/safe-browsing/reference/rest/v5alpha1/hashList#HashList)`)` The hash lists in the same order given in the request. |"]]