Method: hashLists.batchGet
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Pobieranie wielu list haszy naraz.
Bardzo często zdarza się, że klient potrzebuje kilku list haszowanych adresów. Korzystanie z tej metody jest lepsze niż wielokrotne wywoływanie zwykłej metody Get.
Jest to standardowa metoda zbiorczego pobierania zgodnie ze specyfikacją https://google.aip.dev/231, a metoda HTTP to również GET.
Żądanie HTTP
GET https://safebrowsing.googleapis.com/v5alpha1/hashLists:batchGet
Adres URL używa składni transkodowania gRPC.
Parametry zapytania
Parametry |
names[] |
string
Wymagane. nazwy poszczególnych list haszowanych; Może to być lista zagrożeń lub globalny bufor. Nazwy NIE MOGĄ zawierać duplikatów. W przeciwnym razie klient otrzyma komunikat o błędzie.
|
version[] |
string (bytes format)
Wersje listy haszy, które klient już ma. Jeśli klient pobiera listy hasz po raz pierwszy, to pole powinno pozostać puste. W przeciwnym razie klient powinien podać wersje otrzymane wcześniej od serwera. Klient NIE MOŻE manipulować tymi bajtami. Klient nie musi wysyłać wersji w tej samej kolejności co nazwy odpowiednich list. Klient może wysłać w żądaniu mniej lub więcej wersji niż jest nazw. Klient NIE MOŻE jednak wysyłać wielu wersji o tej samej nazwie. W przeciwnym razie pojawi się błąd. Uwaga historyczna: w wersji 4 interfejsu API ta metoda miała nazwę states . W celu zwiększenia przejrzystości zmieniliśmy ją na version . Ciąg znaków zakodowany w formacie Base64.
|
sizeConstraints |
object (SizeConstraints )
Ograniczenia rozmiaru na poszczególnych listach. Jeśli pominiesz to pole, nie będzie żadnych ograniczeń. Pamiętaj, że rozmiary są podawane osobno dla każdej listy, a nie jako suma rozmiarów ze wszystkich list.
|
Treść żądania
Treść żądania musi być pusta.
Treść odpowiedzi
Odpowiedź zawierająca wiele list haszy.
W przypadku powodzenia treść żądania zawiera dane o następującej strukturze:
Zapis JSON |
{
"hashLists": [
{
object (HashList )
}
]
} |
Pola |
hashLists[] |
object (HashList )
listy haszy w takim samym porządku jak w żądaniu;
|
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-25 UTC.
[null,null,["Ostatnia aktualizacja: 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. |"]]