Method: hashLists.batchGet
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
รับรายการแฮชหลายรายการพร้อมกัน
ลูกค้ามักต้องการรับรายการแฮชหลายรายการ เราขอแนะนำให้ใช้เมธอดนี้แทนการใช้เมธอด Get ปกติหลายครั้ง
นี่คือเมธอด Get แบบเป็นกลุ่มมาตรฐานตามที่ระบุไว้ใน https://google.aip.dev/231 และเมธอด HTTP ก็เป็น GET ด้วย
คำขอ HTTP
GET https://safebrowsing.googleapis.com/v5/hashLists:batchGet
URL ใช้ไวยากรณ์การแปลง gRPC
พารามิเตอร์การค้นหา
พารามิเตอร์ |
names[] |
string
ต้องระบุ ชื่อของรายการแฮชที่เฉพาะเจาะจง รายการดังกล่าวอาจเป็นรายการภัยคุกคามหรืออาจเป็นแคชส่วนกลาง ชื่อต้องไม่ซ้ำกัน มิเช่นนั้นไคลเอ็นต์จะได้รับข้อผิดพลาด
|
version[] |
string (bytes format)
เวอร์ชันของรายการแฮชที่ไคลเอ็นต์มีอยู่แล้ว หากเป็นครั้งที่ลูกค้าดึงข้อมูลรายการแฮชเป็นครั้งแรก ให้ปล่อยช่องนี้ว่างไว้ มิเช่นนั้น ไคลเอ็นต์ควรระบุเวอร์ชันที่ได้รับจากเซิร์ฟเวอร์ก่อนหน้านี้ ไคลเอ็นต์ต้องไม่ดัดแปลงไบต์เหล่านั้น ลูกค้าไม่จำเป็นต้องส่งเวอร์ชันตามลําดับเดียวกับชื่อรายการที่เกี่ยวข้อง ลูกค้าอาจส่งเวอร์ชันในคำขอน้อยกว่าหรือมากกว่าจำนวนชื่อ อย่างไรก็ตาม ลูกค้าต้องไม่ส่งหลายเวอร์ชันที่ตรงกับชื่อเดียวกัน หากส่ง ลูกค้าจะได้รับข้อผิดพลาด หมายเหตุเกี่ยวกับประวัติ: ใน API เวอร์ชัน 4 เรียก API นี้ว่า 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. |"]]