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

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

การแมป RPC แบบ Protocol Buffer กับ 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: "/v20/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: "/v20/customers/{customer_id=*}:createCustomerClient"
    body: "*"
  };
  option (google.api.method_signature) = "customer_id,customer_client";
}

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