Method: hashLists.batchGet
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Receba várias listas de hashes de uma só vez.
É muito comum que um cliente precise acessar várias listas de hashes. É preferível usar esse método em vez do método Get normal várias vezes.
Este é um método padrão de lote GET, conforme definido em https://google.aip.dev/231, e o método HTTP também é GET.
Solicitação HTTP
GET https://safebrowsing.googleapis.com/v5/hashLists:batchGet
O URL usa a sintaxe de transcodificação gRPC.
Parâmetros de consulta
Parâmetros |
names[] |
string
Obrigatório. Os nomes das listas de hash específicas. A lista pode ser uma lista de ameaças ou o cache global. Os nomes NÃO podem conter duplicatas. Caso contrário, o cliente vai receber um erro.
|
version[] |
string (bytes format)
As versões da lista de hashes que o cliente já tem. Se esta for a primeira vez que o cliente está buscando as listas de hash, o campo precisa estar vazio. Caso contrário, o cliente precisa fornecer as versões recebidas anteriormente do servidor. O cliente NÃO PODE manipular esses bytes. O cliente não precisa enviar as versões na mesma ordem dos nomes de lista correspondentes. O cliente pode enviar mais ou menos versões em uma solicitação do que nomes. No entanto, o cliente NÃO PODE enviar várias versões que correspondam ao mesmo nome. Se isso acontecer, o cliente vai receber um erro. Observação histórica: na V4 da API, isso era chamado de states . Agora, ele foi renomeado como version para maior clareza. Uma string codificada em base64.
|
sizeConstraints |
object (SizeConstraints )
As restrições de tamanho em cada lista. Se omitido, não há restrições. Os tamanhos aqui são por lista, não agregados em todas as listas.
|
Corpo da solicitação
O corpo da solicitação precisa estar vazio.
Corpo da resposta
A resposta que contém várias listas de hash.
Se bem-sucedido, o corpo da resposta incluirá dados com a estrutura a seguir:
Representação JSON |
{
"hashLists": [
{
object (HashList )
}
]
} |
Campos |
hashLists[] |
object (HashList )
O hash é listado na mesma ordem fornecida na solicitação.
|
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2025-07-25 UTC.
[null,null,["Última atualização 2025-07-25 UTC."],[],[],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. |"]]