WebResource: getToken
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
認証が必要です
認証されたユーザーがウェブサイトまたはドメインに配置するための確認トークンを取得します。
実習をご覧ください。
リクエスト
HTTP リクエスト
POST https://www.googleapis.com/siteVerification/v1/token
承認
このリクエストは、少なくとも次のうち 1 つのスコープでの承認が必要です(認証と承認の詳細をご確認ください)。
スコープ |
https://www.googleapis.com/auth/siteverification |
https://www.googleapis.com/auth/siteverification.verify_only |
リクエスト本文
リクエストの本文には、以下の構造を使用してデータを指定してください。
{
"site": {
"type": string,
"identifier": string
},
"verificationMethod": string
}
プロパティ名 |
値 |
説明 |
メモ |
site |
object |
確認トークンを生成するサイトのアドレスと種類のコンテナ 。 |
|
site.type |
string |
検証するリソースのタイプ。
有効な値は次のとおりです。
- "
ANDROID_APP "
- "
INET_DOMAIN "
- 「
SITE 」
|
|
site.identifier |
string |
サイト ID。タイプが SITE に設定されている場合、識別子は URL です。タイプが INET_DOMAIN に設定されている場合、識別子はドメイン名です。 |
|
verificationMethod |
string |
このサイトまたはドメインの所有権を証明するために使用するサイト確認システムの確認方法。
指定できる値は次のとおりです。
<ph type="x-smartling-placeholder"></ph>
- "
ANALYTICS ": サイトのみ
- 「
DNS 」: 代わりに DNS_TXT を使用
- "
DNS_CNAME ": ドメインのみ
- "
DNS_TXT ": ドメインのみ
- "
FILE ": サイトのみ
- "
META ": サイトのみ
- "
TAG_MANAGER ": サイトのみ
|
|
レスポンス
成功すると、このメソッドは次の構造を含むレスポンスの本文を返します。
{
"method": string,
"token": string
}
プロパティ名 |
値 |
説明 |
メモ |
method |
string |
リクエストで選択した確認方法。
有効な値は次のとおりです。
- "
ANALYTICS "
- "
DNS "
- "
DNS_CNAME "
- "
DNS_TXT "
- "
FILE "
- "
META "
- 「
TAG_MANAGER 」
|
|
token |
string |
選択した確認方法で、認証済みユーザーのサイトに配置する文字列。詳しくは、スタートガイドの確認方法とトークンをご覧ください。 |
|
試してみよう:
以下の API Explorer を使用して、ライブデータに対してこのメソッドを呼び出し、レスポンスを確認してください。
または、
スタンドアロン
エクスプローラをご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-25 UTC。"],[[["\u003cp\u003eRetrieves a verification token for website or domain ownership verification upon authorization.\u003c/p\u003e\n"],["\u003cp\u003eSupports various verification methods including \u003ccode\u003eANALYTICS\u003c/code\u003e, \u003ccode\u003eDNS\u003c/code\u003e, \u003ccode\u003eDNS_CNAME\u003c/code\u003e, \u003ccode\u003eDNS_TXT\u003c/code\u003e, \u003ccode\u003eFILE\u003c/code\u003e, \u003ccode\u003eMETA\u003c/code\u003e, and \u003ccode\u003eTAG_MANAGER\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eRequires specifying the site type (\u003ccode\u003eSITE\u003c/code\u003e, \u003ccode\u003eINET_DOMAIN\u003c/code\u003e, or \u003ccode\u003eANDROID_APP\u003c/code\u003e) and identifier (URL or domain name).\u003c/p\u003e\n"],["\u003cp\u003eReturns the selected verification method and the corresponding token to be placed on the site.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization is required with the \u003ccode\u003esiteverification\u003c/code\u003e or \u003ccode\u003esiteverification.verify_only\u003c/code\u003e scope.\u003c/p\u003e\n"]]],["To get a verification token, send a POST request to the specified URL, including authorization with the correct scope. The request body must contain a `site` object with the `type` (e.g., `SITE`, `INET_DOMAIN`) and `identifier` (e.g., URL, domain name) of the site, as well as the desired `verificationMethod`. The successful response will return the chosen `method` and the `token` string to be placed on the site for verification.\n"],null,[]]