前提条件
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
最初のクライアント アプリケーションのコーディングを開始する前に、行うことがいくつかあります。
Google アカウントを取得する
Google API Console でプロジェクトを作成するには、Google アカウントが必要です。すでにアカウントをお持ちの場合は、準備が整っています。
テスト用に別の Google アカウントを取得することもできます。
Google AdMob を試す
この API ドキュメントは、Google AdMob を使用していて、ウェブ プログラミングの概念やウェブ用のデータ形式の知識があることを前提としています。
Google AdMob を初めて使用する場合は、コーディングを始める前に、管理画面をお試しください。
クライアントのプロジェクトを作成する
Google AdMob にリクエストを送信する前に、クライアントについて Google に伝え、API へのアクセスを有効にする必要があります。これを行うには、Google API Console を使用してプロジェクト(設定と API アクセス情報の名前付きコレクション)を作成し、アプリケーションを登録します。
AdMob API の使用を開始するには、
設定ツールを使用して、Google Cloud コンソールでプロジェクトを作成する手順が
Google API Console、API の有効化、認証情報の作成
REST の基礎を学習する
REST は、データをリクエストして変更するための便利で一貫したアプローチを提供するソフトウェア アーキテクチャのスタイルです。
REST という用語は「Representational State Transfer」の省略形です。Google API のコンテキストでは、HTTP 動詞を使用して、Google が保存しているデータ表現を取得および変更することを表しています。
RESTful システムでは、リソースはデータストアに保存されており、クライアントはサーバーが特定のアクション(リソースの作成、取得、更新、削除など)を実行するようにリクエストを送信し、サーバーはそのアクションを実行し、多くの場合、指定されたリソースの表現形式でレスポンスを送信します。
Google の RESTful API では、クライアントは POST
、GET
、PUT
、DELETE
などの HTTP 動詞を使用してアクションを指定します。また、次の形式のグローバルに一意な URI でリソースを指定します。
https://www.googleapis.com/apiName/apiVersion/resourcePath?parameters
すべての API リソースは HTTP でアクセス可能な一意の URI を持っているため、REST はデータ キャッシュを有効にし、ウェブの分散インフラストラクチャで動作するように最適化されています。
HTTP 1.1 標準のドキュメントのメソッド定義をご覧ください。GET
、POST
、PUT
、DELETE
の仕様が記載されています。
AdMob API の REST
AdMob API のオペレーションは REST の HTTP 動詞に直接マッピングされています。
AdMob API URI の具体的な形式は次のとおりです。
https://admob.googleapis.com/v1/resourcePath?parameters
API でサポートされている各オペレーションで使用される URI の全一覧については、AdMob API リファレンス ドキュメントをご覧ください。
JSON の基礎を学習する
AdMob API はデータを JSON 形式で返します。
JSON(JavaScript Object Notation)は言語に依存しない一般的なデータ フォーマットであり、任意のデータ構造を単純なテキスト形式で表示します。詳しくは json.org をご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-31 UTC。
[null,null,["最終更新日 2025-08-31 UTC。"],[[["\u003cp\u003eBefore coding, you need a Google Account (potentially a separate one for testing) and familiarity with Google AdMob.\u003c/p\u003e\n"],["\u003cp\u003eYou must create a project in the Google API Console using the provided setup tool to enable API access for your client application.\u003c/p\u003e\n"],["\u003cp\u003eThe AdMob API utilizes RESTful architecture, meaning you should understand basic REST principles and HTTP verbs for interacting with resources.\u003c/p\u003e\n"],["\u003cp\u003eData is exchanged in JSON format, so familiarity with JSON structure and parsing is beneficial.\u003c/p\u003e\n"]]],[],null,["# Prerequisites\n\nBefore you can start coding your first client application, there are a few\nthings you need to do, if you haven't done them already.\n\nGet a Google Account\n--------------------\n\nYou need a [Google Account](https://www.google.com/accounts/NewAccount) in order to [create a project](#project) in the Google API Console. If you already have an account, then you're all set.\n\nYou might also want a separate Google Account for testing purposes.\n\nTry out Google AdMob\n--------------------\n\nThis API documentation assumes that you've used Google AdMob, and that you're familiar with web programming concepts and web data formats.\n\nIf you haven't used Google AdMob, then try out the [user interface](https://admob.google.com) before starting to code.\n\nCreate a project for your client\n--------------------------------\n\nBefore you can send requests to Google AdMob, you need to tell Google about your client and activate access to the API. You do this by using the Google API Console to create a project, which is a named collection of settings and API access information, and register your application.\n\nTo get started using AdMob API, you need to first\n[use\nthe setup tool](https://console.cloud.google.com/start/api?id=admob.googleapis.com&credential=client_key), which guides you through creating a project in the\nGoogle API Console, enabling the API, and creating credentials.\n\nLearn REST basics\n-----------------\n\nREST is a style of software architecture that provides a convenient and consistent approach to requesting and modifying data.\n\nThe term REST is short for \"[Representational State Transfer](https://en.wikipedia.org/wiki/Representational_state_transfer).\" In the context of Google APIs, it refers to using HTTP verbs to retrieve and modify representations of data stored by Google.\n\nIn a RESTful system, resources are stored in a data store; a client sends a request that the server perform a particular action (such as creating, retrieving, updating, or deleting a resource), and the server performs the action and sends a response, often in the form of a representation of the specified resource.\n\nIn Google's RESTful APIs, the client specifies an action using an HTTP verb such as `POST`, `GET`, `PUT`, or `DELETE`. It specifies a resource by a globally-unique URI of the following form: \n\n```\nhttps://www.googleapis.com/apiName/apiVersion/resourcePath?parameters\n```\n\nBecause all API resources have unique HTTP-accessible URIs, REST enables data caching and is optimized to work with the web's distributed infrastructure.\n\nYou may find the [method definitions](https://tools.ietf.org/html/rfc7231#section-4.3) in the HTTP 1.1 standards documentation useful; they include specifications for `GET`, `POST`, `PUT`, and `DELETE`.\n\n### REST in the AdMob API\n\nThe AdMob API operations map directly to REST HTTP verbs.\n\nThe specific formats for AdMob API URIs are: \n\n```\nhttps://admob.googleapis.com/v1/resourcePath?parameters\n```\n\nThe full set of URIs used for each supported operation in the API is summarized in the [AdMob API Reference](/admob/api/v1/reference/rest) document.\n\nLearn JSON basics\n-----------------\n\nThe AdMob API returns data in JSON format.\n\n\n[JSON](http://en.wikipedia.org/wiki/JSON) (JavaScript Object Notation) is a common, language-independent data format that provides a simple text representation of arbitrary data structures. For more information, see [json.org](http://www.json.org/).\n\n\u003cbr /\u003e"]]