WebResource: getToken
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
승인 필요
인증된 사용자가 웹사이트나 도메인에 배치할 인증 토큰을 가져옵니다.
지금 사용해 보기
요청
HTTP 요청
POST https://www.googleapis.com/siteVerification/v1/token
승인
이 요청에는 다음 범위 중 최소 하나를 사용하여 인증이 필요합니다. (인증 및 승인에 대해 자세히 알아보기)
범위 |
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 |
확인할 리소스 유형입니다.
사용 가능한 값은 다음과 같습니다.
<ph type="x-smartling-placeholder"></ph>
- "
ANDROID_APP "
- "
INET_DOMAIN "
- "
SITE "
|
|
site.identifier |
string |
사이트 식별자입니다. 유형이 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 |
요청에서 선택한 인증 방법입니다.
사용 가능한 값은 다음과 같습니다.
<ph type="x-smartling-placeholder"></ph>
- "
ANALYTICS "
- "
DNS "
- "
DNS_CNAME "
- "
DNS_TXT "
- "
FILE "
- "
META "
- "
TAG_MANAGER "
|
|
token |
string |
선택한 확인 방법을 사용하여 인증된 사용자의 사이트에 배치할 문자열입니다. 자세한 내용은 시작하기 문서의 확인 방법 및 토큰을 참조하세요. |
|
사용해 보기
아래의 API 탐색기를 사용하여 실시간 데이터를 대상으로 이 메소드를 호출하고 응답을 확인해 보세요.
또는 독립형 탐색기를 사용해 보세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 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,["# WebResource: getToken\n\n**Requires [authorization](#auth)**\n\nGets a verification token for the authenticated user to place on a website or domain.\n[Try it now](#try-it).\n\nRequest\n-------\n\n### HTTP request\n\n```\nPOST https://www.googleapis.com/siteVerification/v1/token\n```\n\n### Authorization\n\nThis request requires authorization with at least one of the following scopes ([read more about authentication and authorization](/site-verification/v1/getting_started#auth)).\n\n| Scope |\n|----------------------------------------------------------------|\n| `https://www.googleapis.com/auth/siteverification` |\n| `https://www.googleapis.com/auth/siteverification.verify_only` |\n\n### Request body\n\nIn the request body, supply data with the following structure:\n\n```carbon\n{\n \"site\": {\n \"type\": string,\n \"identifier\": string\n },\n \"verificationMethod\": string\n}\n```\n\n| Property name | Value | Description | Notes |\n|----------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------|\n| `site` | `object` | Container for the address and type of a site for which a verification token will be generated. | |\n| site.`type` | `string` | The type of resource to be verified. \u003cbr /\u003e Acceptable values are: - \"`ANDROID_APP`\" - \"`INET_DOMAIN`\" - \"`SITE`\" | |\n| site.`identifier` | `string` | The site identifier. If the type is set to `SITE`, the identifier is a URL. If the type is set to `INET_DOMAIN`, the identifier is a domain name. | |\n| `verificationMethod` | `string` | The verification method for the Site Verification system to use to verify this site or domain. \u003cbr /\u003e Acceptable values are: - \"`ANALYTICS`\": Sites only - \"`DNS`\": Use DNS_TXT instead - \"`DNS_CNAME`\": Domains only - \"`DNS_TXT`\": Domains only - \"`FILE`\": Sites only - \"`META`\": Sites only - \"`TAG_MANAGER`\": Sites only | |\n\nResponse\n--------\n\nIf successful, this method returns a response body with the following structure:\n\n```text\n{\n \"method\": string,\n \"token\": string\n}\n```\n\n| Property name | Value | Description | Notes |\n|---------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------|\n| `method` | `string` | The verification method that you selected in the request. \u003cbr /\u003e Acceptable values are: - \"`ANALYTICS`\" - \"`DNS`\" - \"`DNS_CNAME`\" - \"`DNS_TXT`\" - \"`FILE`\" - \"`META`\" - \"`TAG_MANAGER`\" | |\n| `token` | `string` | The string to place on the authenticated user's site, using the selected verification method. For more information, see [Verification methods and tokens](/site-verification/v1/getting_started#tokens) in the Getting Started document. | |\n\nTry it!\n-------\n\n\nUse the APIs Explorer below to call this method on live data and see the response.\nAlternatively, try the\n[standalone\nExplorer](https://developers.google.com/apis-explorer/#p/siteVerification/v1/siteVerification.webResource.getToken)."]]