注意: API の REST インターフェースに関するドキュメントを表示しています。当社の公式クライアント ライブラリのほとんどは gRPC を使用しています。詳しくは、
REST の概要をご覧ください。
Service メソッド
Google Ads API の設計は、従来の REST アーキテクチャとは異なります。主に、従来の list
、get
、create
、update
、delete
メソッドではなく、search
や mutate,
などのカスタム メソッドを使用しているためです。これらのアクションは、:
の HTTP マッピング規則を使用して、カスタム動詞を URL の残りの部分から分離することで、REST URL で表されます。
たとえば、キャンペーンの変更 API 呼び出しでは次の URL が使用されます。
https://googleads.googleapis.com/v19/customers/1234567890/campaigns:mutate
API がカスタム メソッドを使用する理由の 1 つは、複数のオペレーションを 1 つの API リクエストにバッチ処理できるようにするためです。厳密な REST セマンティクスでは、一度に更新できるキャンペーンは 1 つのみです。たとえば、キャンペーンへの従来の REST update
では、キャンペーン リソースごとに 1 つの HTTP PATCH リクエストを送信する必要があります。
多くのオペレーションを 1 つのリクエスト本文にまとめることができるように、Google Ads API では、ほとんどのリソースにカスタム mutate
メソッドが定義されています。同様に、API からのバッチ読み取り(複数のオブジェクトを一度に取得)を有効にするために、API は SQL に似た Google 広告クエリ言語でカスタム search
メソッドを使用します。
一般的なメソッドのページでは、Google 広告 API で最もよく使用されるメソッドについて詳しく説明しています。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-02-28 UTC。
[null,null,["最終更新日 2025-02-28 UTC。"],[[["The Google Ads API utilizes custom methods like `search` and `mutate` instead of standard REST methods for efficiency and batch operations."],["This approach allows for updating multiple campaigns or fetching numerous objects within a single request, unlike traditional REST."],["Custom methods are expressed in REST URLs using a colon to separate the verb from the rest of the URL, for example, `https://googleads.googleapis.com/v18/customers/1234567890/campaigns:mutate`."],["Batching operations, like updating many campaigns simultaneously, are enabled through the custom `mutate` method, improving efficiency over individual requests."],["The `search` method uses a SQL-like query language for batch reads, enabling retrieval of multiple objects in one API call."]]],["The Google Ads API uses custom methods like `search` and `mutate` instead of standard REST methods (e.g., `list`, `get`). This is indicated in URLs by a `:` separator. `Mutate` enables batching multiple operations into one request, unlike standard `update`, which handles one campaign at a time. Similarly, `search` allows fetching multiple objects in a single request, utilizing a SQL-like query language. This deviates from REST conventions to facilitate efficient batch processing and querying.\n"]]