Method: hashLists.batchGet
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
چندین لیست هش را به طور همزمان دریافت کنید.
بسیار معمول است که یک مشتری نیاز به دریافت لیست های هش متعدد داشته باشد. استفاده از این روش بر استفاده از روش دریافت معمولی در چندین بار ارجحیت دارد.
این یک روش استاندارد دسته ای دریافت است که توسط https://google.aip.dev/231 تعریف شده است و روش HTTP نیز GET است.
درخواست HTTP
GET https://safebrowsing.googleapis.com/v5/hashLists:batchGet
URL از دستور GRPC Transcoding استفاده می کند.
پارامترهای پرس و جو
پارامترها |
---|
names[] | string مورد نیاز. نام لیست های هش خاص. لیست ممکن است یک لیست تهدید باشد یا ممکن است کش جهانی باشد. نام ها نباید دارای موارد تکراری باشند. اگر آنها این کار را انجام دهند، مشتری یک خطا دریافت می کند. |
version[] | string ( bytes format) نسخه هایی از لیست هش که مشتری از قبل دارد. اگر این اولین بار است که مشتری لیست های هش را واکشی می کند، فیلد باید خالی بماند. در غیر این صورت، کلاینت باید نسخه هایی را که قبلاً از سرور دریافت کرده است، ارائه کند. کلاینت نباید آن بایت ها را دستکاری کند. مشتری نیازی به ارسال نسخه ها به همان ترتیب نام لیست مربوطه ندارد. مشتری ممکن است نسخه های کمتر یا بیشتر از نام های موجود را در یک درخواست ارسال کند. با این حال مشتری نباید چندین نسخه را که با یک نام مطابقت دارند ارسال کند. اگر این کار را کرد، مشتری یک خطا دریافت می کند. یادداشت تاریخی: در V4 از API، این states نامیده می شد. اکنون برای وضوح به version تغییر نام داده شده است. رشته ای با کد base64. |
sizeConstraints | object ( SizeConstraints ) محدودیت اندازه در هر لیست. در صورت حذف، هیچ محدودیتی وجود ندارد. توجه داشته باشید که اندازهها در اینجا بهازای هر فهرست هستند، در همه فهرستها جمعآوری نشدهاند. |
درخواست بدن
بدنه درخواست باید خالی باشد.
بدن پاسخگو
پاسخ حاوی چندین لیست هش است.
در صورت موفقیت آمیز بودن، بدنه پاسخ حاوی داده هایی با ساختار زیر است:
نمایندگی JSON |
---|
{
"hashLists": [
{
object (HashList )
}
]
} |
فیلدها |
---|
hashLists[] | object ( HashList ) لیست های هش به همان ترتیبی که در درخواست ارائه شده است. |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی."],[],[],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/v5/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/v5/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/v5/hashList#HashList) } ] } ``` |\n\n| Fields ||\n|---------------|------------------------------------------------------------------------------------------------------------------------------------|\n| `hashLists[]` | `object (`[HashList](/safe-browsing/reference/rest/v5/hashList#HashList)`)` The hash lists in the same order given in the request. |"]]