แม้ว่า Mutate
, Search
และ SearchStream
จะเป็นวิธีที่ใช้กันมากที่สุดใน Google Ads API แต่ก็ยังมีวิธีอื่นๆ อีกมากมายสำหรับวัตถุประสงค์เฉพาะ บริการทั้งหมดและ API ของบริการ จะมีการระบุไว้ในเอกสารอ้างอิงของ REST
บัฟเฟอร์โปรโตคอล RPC ไปยังการแมป REST
ปลายทางบริการทั้งหมด (ไม่ว่าจะใช้ REST และ gRPC) ได้รับการกําหนดไว้ในไฟล์ .Proto ของแพ็กเกจบริการโดยใช้ภาษาคำจำกัดความอินเทอร์เฟซ Proto3
ตัวอย่าง: ListAccessibleCustomers
เช่น ไฟล์ customer_service.proto
จะกำหนดเมธอด ListAccessibleCustomers
เพิ่มเติมจาก Mutate
มาตรฐาน คำอธิบายประกอบ google.api.http
ของคำอธิบาย
อธิบายวิธีที่เมธอดแมปกับ HTTP ใช้ HTTP GET
ที่มีคำกริยาที่กำหนดเอง listAccessibleCustomers
:
rpc ListAccessibleCustomers(ListAccessibleCustomersRequest) returns (ListAccessibleCustomersResponse) { option (google.api.http) = { get: "/v17/customers:listAccessibleCustomers" }; }
ซึ่งแมปกับเมธอด REST customers.listAccessibleCustomers
ตัวอย่าง: CreateCustomerClient
อีกตัวอย่างหนึ่งจาก customer_service.proto
คือเมธอด CreateCustomerClient
คำอธิบายประกอบ google.api.http
ของวิดีโออธิบาย HTTP POST
โดยใช้คำกริยาที่กำหนดเอง createCustomerClient
ดังนี้
rpc CreateCustomerClient(CreateCustomerClientRequest) returns (CreateCustomerClientResponse) { option (google.api.http) = { post: "/v17/customers/{customer_id=*}:createCustomerClient" body: "*" }; option (google.api.method_signature) = "customer_id,customer_client"; }
ซึ่งจะแมปกับเมธอด REST customers.createCustomerClient