Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
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 |
要驗證的資源類型。
可接受的值為:
- 「
ANDROID_APP」
- 「
INET_DOMAIN」
- 「
SITE」
|
|
site.identifier |
string |
網站 ID。如果類型設為 SITE,ID 就是網址。如果類型設為 INET_DOMAIN,ID 為網域名稱。 |
|
verificationMethod |
string |
網站驗證系統用來驗證此網站或網域的方法。
可接受的值為:
- 「
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 |
要放在已驗證使用者網站上的字串,需透過所選驗證方法。詳情請參閱入門指南文件中的驗證方法和權杖。 |
|
試試看!
使用下方的 APIs Explorer,針對即時資料呼叫這個方法,看看會有什麼結果。
您也可以改用
獨立式
Explorer。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2026-02-18 (世界標準時間)。
[[["容易理解","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"]],["上次更新時間:2026-02-18 (世界標準時間)。"],[],["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"]]