זהירות: אתה צופה בתיעוד עבור ממשק ה-API ל-REST. רוב ספריות הלקוחות הרשמיות שלנו משתמשות ב-gRPC. פרטים נוספים זמינים ב
מבוא ל-REST.
שיטות אחרות
השיטות Mutate
, Search
ו-SearchStream
הן השיטות הנפוצות ביותר ב-Google Ads API, אבל יש עוד הרבה שיטות למטרות ספציפיות. כל השירותים וממשקי ה-API שלהם מתועדים במסמכי העזר של REST.
מיפויים של Protocol Buffer RPC ל-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: "/v19/customers:listAccessibleCustomers"
};
}
הקריאה הזו ממופה לשיטת ה-REST customers.listAccessibleCustomers.
דוגמה: CreateCustomerClient
דוגמה נוספת מ-customer_service.proto
היא השיטה CreateCustomerClient
. ההערה google.api.http
מתארת POST
של HTTP באמצעות הפועל בהתאמה אישית 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";
}
הקריאה הזו ממופה לשיטת ה-REST customers.createCustomerClient.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-03-01 (שעון UTC).
[null,null,["עדכון אחרון: 2025-03-01 (שעון UTC)."],[[["While `Mutate`, `Search`, and `SearchStream` are commonly used, the Google Ads API offers a wide range of methods for specific tasks, all documented in the REST reference documentation."],["All Google Ads API service endpoints, including REST and gRPC, are defined in .proto files using the proto3 Interface Definition Language."],["The `google.api.http` annotation within these .proto files details how each method maps to HTTP for RESTful interactions, including examples like `ListAccessibleCustomers` and `CreateCustomerClient`."]]],["The Google Ads API includes various methods beyond `Mutate`, `Search`, and `SearchStream`, all detailed in REST documentation. Service endpoints are defined in `.proto` files using proto3. `ListAccessibleCustomers` is a GET method, mapped using the `google.api.http` annotation in the `customer_service.proto` file, and uses custom verb `listAccessibleCustomers`. Similarly, `CreateCustomerClient`, a POST method, uses custom verb `createCustomerClient`, also defined in the same file.\n"]]