Google Ads API में Mutate
, Search
, और SearchStream
सबसे आम तरीके हैं. हालांकि, खास मकसद के लिए इनके अलावा भी कई तरीके हैं. सभी सेवाओं और उनके एपीआई का दस्तावेज़, REST रेफ़रंस दस्तावेज़ में दिया गया है.
प्रोटोकॉल बफ़र RPC से REST मैपिंग
सेवा के सभी एंडपॉइंट (चाहे REST और gRPC का इस्तेमाल कर रहे हों) प्रोटो3 इंटरफ़ेस डेफ़िनिशन लैंग्वेज का इस्तेमाल करके सेवाओं के पैकेज की.proto फ़ाइलों में तय किए जाते हैं.
उदाहरण: ListAccessibilityCustomers
उदाहरण के लिए, customer_service.proto
फ़ाइल स्टैंडर्ड Mutate
के अलावा, ListAccessibleCustomers
वाला तरीका बताती है. इसके google.api.http
एनोटेशन में, एचटीटीपी पर मैप करने का तरीका बताया गया है. इसमें कस्टम क्रियाlistAccessibleCustomers
के साथ एचटीटीपी GET
का इस्तेमाल किया गया है:
rpc ListAccessibleCustomers(ListAccessibleCustomersRequest) returns (ListAccessibleCustomersResponse) { option (google.api.http) = { get: "/v17/customers:listAccessibleCustomers" }; }
यह customers.listAccessibleCustomers REST तरीके पर मैप होता है.
उदाहरण: CreateCustomerClient
customer_service.proto
का एक और उदाहरण
CreateCustomerClient
तरीका है. इसके google.api.http
एनोटेशन में, कस्टम क्रिया createCustomerClient
का इस्तेमाल करके एचटीटीपी POST
के बारे में बताया गया है:
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"; }
यह customers.createCustomerClient REST के तरीके पर मैप करता है.