Mặc dù Mutate, Search và SearchStream là những phương thức phổ biến nhất trong API Google Ads, nhưng vẫn còn nhiều phương thức khác cho các mục đích cụ thể. Tất cả các dịch vụ và API của chúng đều được ghi lại trong tài liệu tham khảo.
Mối liên kết giữa RPC vùng đệm giao thức và REST
Tất cả các điểm cuối dịch vụ (cho dù sử dụng REST và gRPC) cuối cùng đều được xác định trong các tệp.proto của gói dịch vụ bằng Ngôn ngữ định nghĩa giao diện proto3.
Ví dụ: ListAccessibleCustomers
Ví dụ: tệp customer_service.proto xác định phương thức ListAccessibleCustomers, ngoài Mutate chuẩn. Chú giải google.api.http mô tả cách phương thức này liên kết với HTTP. Nó sử dụng một GET HTTP với động từ tuỳ chỉnh listAccessibleCustomers:
rpc ListAccessibleCustomers(ListAccessibleCustomersRequest) returns (ListAccessibleCustomersResponse) { option (google.api.http) = { get: "/v23/customers:listAccessibleCustomers" }; }
Thao tác này liên kết với phương thức REST customers.listAccessibleCustomers.
Ví dụ: CreateCustomerClient
Một ví dụ khác từ customer_service.proto là phương thức CreateCustomerClient. Chú giải google.api.http mô tả một POST HTTP bằng cách sử dụng động từ tuỳ chỉnh createCustomerClient:
rpc CreateCustomerClient(CreateCustomerClientRequest) returns (CreateCustomerClientResponse) { option (google.api.http) = { post: "/v23/customers/{customer_id=*}:createCustomerClient" body: "*" }; option (google.api.method_signature) = "customer_id,customer_client"; }
Thao tác này tương ứng với phương thức REST customers.createCustomerClient.