วิธีการอื่นๆ

ในขณะที่ Mutate, Search และ SearchStream เป็นเมธอดที่ใช้กันมากที่สุด ใน Google Ads API แต่ก็ยังมีเมธอดอื่นๆ อีกมากมายสำหรับวัตถุประสงค์เฉพาะ เราได้จัดทำเอกสารประกอบเกี่ยวกับบริการและ API ทั้งหมดไว้ใน เอกสารอ้างอิง

การแมป RPC แบบบัฟเฟอร์โปรโตคอลกับ REST

ปลายทางบริการทั้งหมด (ไม่ว่าจะใช้ REST หรือ gRPC) จะกำหนดไว้ใน ไฟล์ .proto ของแพ็กเกจบริการ โดยใช้ ภาษาคำจำกัดความอินเทอร์เฟซ proto3

ตัวอย่าง: ListAccessibleCustomers

ตัวอย่างเช่น ไฟล์ customer_service.proto กำหนดเมธอด ListAccessibleCustomers นอกเหนือจาก Mutate มาตรฐาน คำอธิบายประกอบ google.api.http จะอธิบาย วิธีที่เมธอดแมปกับ HTTP โดยใช้ GET HTTP ที่มีคำกริยาที่กำหนดเอง listAccessibleCustomers ดังนี้

rpc ListAccessibleCustomers(ListAccessibleCustomersRequest)
    returns (ListAccessibleCustomersResponse) {
  option (google.api.http) = {
    get: "/v26/customers:listAccessibleCustomers"
  };
}

ซึ่งจะแมปกับเมธอด REST customers.listAccessibleCustomers

ตัวอย่าง: CreateCustomerClient

อีกตัวอย่างหนึ่งจาก customer_service.proto คือ เมธอด CreateCustomerClient คำอธิบายประกอบ google.api.http จะอธิบาย POST HTTP ที่ใช้คำกริยาที่กำหนดเอง createCustomerClient ดังนี้

rpc CreateCustomerClient(CreateCustomerClientRequest)
    returns (CreateCustomerClientResponse) {
  option (google.api.http) = {
    post: "/v26/customers/{customer_id=*}:createCustomerClient"
    body: "*"
  };
  option (google.api.method_signature) = "customer_id,customer_client";
}

ซึ่งจะแมปกับเมธอด REST customers.createCustomerClient