Method: hashLists.batchGet
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
HTTP 要求
GET https://safebrowsing.googleapis.com/v5/hashLists:batchGet
這個網址使用 gRPC 轉碼語法。
查詢參數
參數 |
names[] |
string
必要欄位。特定雜湊清單的名稱。這份清單可能是威脅清單,也可能是全球快取。名稱不得重複,否則用戶端會收到錯誤訊息。
|
version[] |
string (bytes format)
用戶端已擁有的雜湊清單版本。如果這是用戶端第一次擷取雜湊清單,則應將欄位留空。否則,用戶端應提供先前從伺服器收到的版本。用戶端絕對不得操縱這些位元組。 用戶端傳送的版本順序不必與對應的清單名稱相同。用戶端在請求中傳送的版本可能多於或少於名稱。不過,用戶端不得傳送多個與相同名稱相對應的版本,否則會收到錯誤。 歷史註解:在 API 的 V4 版中,這個值稱為 states ;現在已重新命名為 version ,以便清楚表示。 Base64 編碼字串。
|
sizeConstraints |
object (SizeConstraints )
每個清單的大小限制。如果省略,則沒有任何限制。請注意,這裡的大小是每個清單的大小,並未匯總所有清單的大小。
|
回應主體
回應包含多個雜湊清單。
如果成功,回應主體會含有以下結構的資料:
JSON 表示法 |
{
"hashLists": [
{
object (HashList )
}
]
} |
欄位 |
hashLists[] |
object (HashList )
請按照要求中提供的順序列出雜湊清單。
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[],[],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. |"]]