Method: hashLists.batchGet

Get multiple hash lists at once.

It 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.

This is a standard batch Get method as defined by https://google.aip.dev/231 and the HTTP method is also GET.

HTTP request

GET https://safebrowsing.googleapis.com/v5alpha1/hashLists:batchGet

The URL uses gRPC Transcoding syntax.

Query parameters

Parameters
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.

version[]

string (bytes 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.

desiredHashLength

enum (HashLength)

The desired hash prefix length of the returned hashes in bytes. The server will then return all hash prefixes in this specified length.

Different hash lists have different requirements on the acceptable values of desiredHashLength field. This can be found in the supportedHashLengths field in HashListMetadata. If desiredHashLength does not specify a value within supportedHashLengths, an error will be returned to clients.

For the BatchGetHashListsRequest in particular, it is not possible for clients to specify a different desiredHashLength for different lists. If there is a need to do that, the client should split up into multiple BatchGetHashListsRequests.

sizeConstraints

object (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.

Request body

The request body must be empty.

Response body

The response containing multiple hash lists.

If successful, the response body contains data with the following structure:

JSON representation
{
  "hashLists": [
    {
      object (HashList)
    }
  ]
}
Fields
hashLists[]

object (HashList)

The hash lists in the same order given in the request.