Method: hashLists.batchGet
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Mehrere Hash-Listen gleichzeitig abrufen
Es ist sehr häufig, dass ein Client mehrere Hash-Listen abrufen muss. Die Verwendung dieser Methode ist vorzuziehen, anstatt die reguläre Get-Methode mehrmals zu verwenden.
Dies ist eine standardmäßige Batch-Get-Methode gemäß https://google.aip.dev/231 und die HTTP-Methode ist ebenfalls GET.
HTTP-Anfrage
GET https://safebrowsing.googleapis.com/v5alpha1/hashLists:batchGet
Die URL verwendet die Syntax der gRPC-Transcodierung.
Abfrageparameter
Parameter |
names[] |
string
Erforderlich. Die Namen der jeweiligen Hash-Listen. Es kann sich um eine Bedrohungsliste oder um den globalen Cache handeln. Die Namen dürfen KEINE doppelten Einträge enthalten. Andernfalls erhält der Kunde eine Fehlermeldung.
|
version[] |
string (bytes format)
Die Versionen der Hash-Liste, die der Client bereits hat. Wenn der Client die Hash-Listen zum ersten Mal abruft, sollte das Feld leer bleiben. Andernfalls sollte der Client die Versionen angeben, die er zuvor vom Server erhalten hat. Der Client darf diese Bytes NICHT manipulieren. Der Client muss die Versionen nicht in der Reihenfolge der entsprechenden Listennamen senden. Der Client kann in einer Anfrage weniger oder mehr Versionen senden, als es Namen gibt. Der Client darf jedoch KEINE mehrere Versionen mit demselben Namen senden. Andernfalls erhält der Client eine Fehlermeldung. Hinweis zur Versionsgeschichte: In Version 4 der API hieß dieses Feld states . Es wurde aus Gründen der Klarheit in version umbenannt. Ein base64-codierter String.
|
sizeConstraints |
object (SizeConstraints )
Die Größenbeschränkungen für jede Liste. Wenn sie weggelassen wird, gelten keine Einschränkungen. Die hier aufgeführten Größen beziehen sich auf einzelne Listen und nicht auf alle Listen zusammen.
|
Anfragetext
Der Anfragetext muss leer sein.
Antworttext
Die Antwort enthält mehrere Hash-Listen.
Bei Erfolg enthält der Antworttext Daten mit der folgenden Struktur:
JSON-Darstellung |
{
"hashLists": [
{
object (HashList )
}
]
} |
Felder |
hashLists[] |
object (HashList )
Die Hash-Listen in der Reihenfolge, die in der Anfrage angegeben ist.
|
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-25 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-07-25 (UTC)."],[[["\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. |"]]