Method: hashLists.batchGet
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Obtén varias listas de hash a la vez.
Es muy común que un cliente necesite obtener varias listas de hash. Se prefiere usar este método en lugar de usar el método Get normal varias veces.
Este es un método de Get por lotes estándar, como se define en https://google.aip.dev/231, y el método HTTP también es GET.
Solicitud HTTP
GET https://safebrowsing.googleapis.com/v5/hashLists:batchGet
La URL usa la sintaxis de la transcodificación gRPC.
Parámetros de consulta
Parámetros |
names[] |
string
Obligatorio. Los nombres de las listas de hash en particular La lista PUEDE ser una lista de amenazas o la caché global. Los nombres NO DEBEN contener duplicados. De lo contrario, el cliente recibirá un error.
|
version[] |
string (bytes format)
Las versiones de la lista de hash que ya tiene el cliente. Si es la primera vez que el cliente recupera las listas de hash, el campo debe dejarse vacío. De lo contrario, el cliente debe proporcionar las versiones que recibió anteriormente del servidor. El cliente NO DEBE manipular esos bytes. El cliente no necesita enviar las versiones en el mismo orden que los nombres de las listas correspondientes. El cliente puede enviar menos o más versiones en una solicitud que la cantidad de nombres. Sin embargo, el cliente NO DEBE enviar varias versiones que correspondan al mismo nombre. De lo contrario, el cliente recibirá un error. Nota histórica: En la versión 4 de la API, se llamaba states . Ahora, se cambió el nombre a version para mayor claridad. String codificada en base64.
|
sizeConstraints |
object (SizeConstraints )
Las restricciones de tamaño de cada lista Si se omite, no hay restricciones. Ten en cuenta que los tamaños aquí son por lista, no agregados en todas las listas.
|
Cuerpo de la solicitud
El cuerpo de la solicitud debe estar vacío.
Cuerpo de la respuesta
La respuesta contiene varias listas de hash.
Si se ejecuta correctamente, el cuerpo de la respuesta contendrá datos con la siguiente estructura:
Representación JSON |
{
"hashLists": [
{
object (HashList )
}
]
} |
Campos |
hashLists[] |
object (HashList )
Las listas de hash en el mismo orden que se indica en la solicitud
|
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-07-25 (UTC)
[null,null,["Última actualización: 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. |"]]