기타 방법

Mutate, Search, SearchStream가 Google Ads API에서 가장 일반적인 메서드이지만 특정 목적을 위한 다른 메서드도 많이 있습니다. 모든 서비스와 API는 REST 참조 문서에 설명되어 있습니다.

프로토콜 버퍼 RPC와 REST 매핑

모든 서비스 엔드포인트 (REST 및 gRPC 사용 여부와 관계없음)는 궁극적으로 proto3 인터페이스 정의 언어를 사용하여 서비스 패키지의.proto 파일에 정의됩니다.

예: ListAccessibleCustomers

예를 들어 customer_service.proto 파일은 표준 Mutate 외에 ListAccessibleCustomers 메서드를 정의합니다. google.api.http 주석은 메서드가 HTTP에 매핑되는 방식을 설명합니다. 맞춤 동사 listAccessibleCustomers와 함께 HTTP GET를 사용합니다.

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

이는 customers.listAccessibleCustomers REST 메서드에 매핑됩니다.

예: CreateCustomerClient

customer_service.proto의 또 다른 예는 CreateCustomerClient 메서드입니다. google.api.http 주석은 맞춤 동사 createCustomerClient를 사용하는 HTTP POST를 설명합니다.

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";
}

이는 customers.createCustomerClient REST 메서드에 매핑됩니다.