Các phương pháp khác

Mặc dù Mutate, SearchSearchStream là các 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ả dịch vụ và API của chúng được ghi lại trong tài liệu tham khảo về REST.

Liên kết RPC vùng đệm giao thức với REST

Tất cả các điểm cuối dịch vụ (dù sử dụng REST và gRPC) đều được xác định cuối cùng 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 một phương thức ListAccessibleCustomers, ngoài Mutate tiêu chuẩn. Chú thích google.api.http mô tả cách phương thức liên kết với HTTP. Phương thức này sử dụng GET HTTP với động từ tuỳ chỉnh listAccessibleCustomers:

rpc ListAccessibleCustomers(ListAccessibleCustomersRequest)
    returns (ListAccessibleCustomersResponse) {
  option (google.api.http) = {
    get: "/v19/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ả 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: "/v19/customers/{customer_id=*}:createCustomerClient"
    body: "*"
  };
  option (google.api.method_signature) = "customer_id,customer_client";
}

Thao tác này liên kết với phương thức REST customers.createCustomerClient.