Method: hashLists.batchGet
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
複数のハッシュリストを一度に取得します。
クライアントが複数のハッシュリストを取得する必要があることは非常に一般的です。通常の Get メソッドを複数回使用するよりも、このメソッドを使用することをおすすめします。
これは、https://google.aip.dev/231 で定義されている標準のバッチ GET メソッドであり、HTTP メソッドも GET です。
HTTP リクエスト
GET https://safebrowsing.googleapis.com/v5/hashLists:batchGet
この URL は gRPC Transcoding 構文を使用します。
クエリ パラメータ
パラメータ |
names[] |
string
必須。特定のハッシュリストの名前。このリストは脅威リストの場合もあれば、グローバル キャッシュの場合もあります。名前に重複がないようにしてください。重複があると、クライアントにエラーが表示されます。
|
version[] |
string (bytes format)
クライアントがすでに持っているハッシュリストのバージョン。クライアントがハッシュリストを初めて取得する場合は、このフィールドを空のままにします。それ以外の場合は、クライアントはサーバから以前に受信したバージョンを提供する必要があります。クライアントはこれらのバイトを操作してはなりません。 クライアントは、対応するリスト名と同じ順序でバージョンを送信する必要はありません。クライアントは、リクエストで名前の数よりも少ないバージョンまたは多いバージョンを送信できます。ただし、同じ名前に対応する複数のバージョンをクライアントが送信することはできません。送信すると、クライアントにエラーが返されます。 歴史的な注記: API の V4 では、これは states と呼ばれていましたが、わかりやすくするために version に名前が変更されました。 Base64 でエンコードされた文字列。
|
sizeConstraints |
object (SizeConstraints )
各リストのサイズ制約。省略した場合、制約はありません。なお、ここでのサイズはリストごとであり、すべてのリストを合計したものではありません。
|
リクエストの本文
リクエストの本文は空にする必要があります。
レスポンスの本文
複数のハッシュリストを含むレスポンス。
成功した場合、レスポンスの本文には次の構造のデータが含まれます。
JSON 表現 |
{
"hashLists": [
{
object (HashList )
}
]
} |
フィールド |
hashLists[] |
object (HashList )
リクエストされた順序と同じ順序のハッシュリスト。
|
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 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. |"]]