WebResource
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
WebResource 代表已驗證的網站或網域,
其中包含網站或網域的標準 ID、網址或網域名稱,以及擁有者清單。請注意,擁有者清單一律會包含已驗證的使用者,因為只有存取 WebResource 的使用者才是經過驗證的使用者,而且是該網站或網域的擁有者。
如需本資源的方法清單,請見本頁結尾。
資源表示法
{
"id": string,
"site": {
"type": string,
"identifier": string
},
"owners": [
string
]
}
屬性名稱 |
值 |
說明 |
附註 |
id |
string |
用來識別這個網站的字串。在 get、update 和 delete 作業中,應使用這個值在 REST 網址的 id 部分。 |
|
owners[] |
list |
這項資源的所有直接擁有者、已驗證擁有者的電子郵件地址。但不包括間接擁有者 (例如所屬網域的已驗證擁有者)。 |
|
site |
object |
網站的網址和類型容器,說明已驗證或即將驗證的網站。 |
|
site.identifier |
string |
網站 ID,其格式會因 type 屬性值而異。 |
|
site.type |
string |
網站類型。
可接受的值為:
- 「
ANDROID_APP 」:將 identifier 設為 Android 應用程式網址。Example: "android-app://com.google.android.youtube/"
- 「
INET_DOMAIN 」:將 identifier 設為網域名稱。範例:「www.example.com」、「example.com」或「subdomain.example.com」
- 「
SITE 」:將 identifier 設為網站根目錄的完整網址,結尾為 / 標記。Examples: "https://www.example.com/"或「https://www.example.com/subsite/」
|
|
方法
使用 insert 方法,驗證已驗證使用者的網站或網域擁有權。使用 get, update, , 刪除方法可擷取或修改已驗證使用者的資源。
您可以透過 list 查看已驗證使用者的所有已驗證資源,並透過 getToken 取得要在通過驗證的使用者網站上放置的權杖。
- 刪除
- 驗證使用者的網站或網域擁有權。
- 取得
- 擷取網站或網域的最新資料。
- getToken
- 取得已驗證使用者的驗證權杖,方便他們放在網站或網域上。
- 插入
- 驗證網站或網域的擁有權。
- list
- 取得已驗證使用者的已驗證網站和網域清單。
- 更新
- 修改網站或網域的擁有者清單。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eA WebResource represents a verified website or domain and includes its ID, URL/domain, and a list of owners, which always includes the authenticated user.\u003c/p\u003e\n"],["\u003cp\u003eYou can verify ownership, retrieve, update, and delete WebResources using the provided methods.\u003c/p\u003e\n"],["\u003cp\u003eWebResource data includes an ID, owner list, and site information containing the identifier and type (e.g., website, Android app, domain).\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003esite.identifier\u003c/code\u003e can be a domain name, a URL, or an Android app URL depending on the \u003ccode\u003esite.type\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eSeveral methods are available to manage WebResources, including inserting (verifying ownership), retrieving data, updating owner lists, deleting, listing all verified resources, and getting a verification token.\u003c/p\u003e\n"]]],["A WebResource represents a verified website or domain, identified by an `id`, `site` (type and identifier), and a list of `owners`, which always includes the authenticated user. Key actions include using `insert` to verify ownership, `get`, `update`, and `delete` to manage existing resources, `list` to view verified sites, and `getToken` to obtain a verification token. Site `type` can be `ANDROID_APP`, `INET_DOMAIN`, or `SITE`, with corresponding identifier formats.\n"],null,["# WebResource\n\n\u003cbr /\u003e\n\nA WebResource is a representation of a verified website or domain.\n\n\u003cbr /\u003e\n\nIt contains the canonical ID of a site or domain, the URL or domain name, and a list of owners. Note that the owners list always includes the authenticated user, because the only people who can access a WebResource are authenticated users who are owners of that site or domain.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nFor a list of [methods](#methods) for this resource, see the end of this page.\n\nResource representations\n------------------------\n\n\u003cbr /\u003e\n\n```carbon\n{\n \"id\": string,\n \"site\": {\n \"type\": string,\n \"identifier\": string\n },\n \"owners\": [\n string\n ]\n}\n```\n\n| Property name | Value | Description | Notes |\n|-------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------|\n| `id` | `string` | The string used to identify this site. This value should be used in the \u003cvar class=\"apiparam\" translate=\"no\"\u003eid\u003c/var\u003e portion of the REST URL for the [get](/site-verification/v1/webResource/get), [update](/site-verification/v1/webResource/update), and [delete](/site-verification/v1/webResource/delete) operations. | |\n| `owners[]` | `list` | The email addresses of all direct, verified owners of this exact property. Indirect owners---for example verified owners of the containing domain---are not included in this list. | |\n| `site` | `object` | Container for the address and type of a site that is verified or will be verified. | |\n| site.`identifier` | `string` | The site identifier, which takes different forms depending on the value of the `type` property. | |\n| site.`type` | `string` | The site type. \u003cbr /\u003e Acceptable values are: - \"`ANDROID_APP`\": Set `identifier` to an Android app URL. **Example:** \"android-app://com.google.android.youtube/\" - \"`INET_DOMAIN`\": Set `identifier` to a domain name. **Examples:** \"www.example.com\", \"example.com\" or \"subdomain.example.com\" - \"`SITE`\": Set `identifier` to a fully-qualified URL for your site root, ending in a / mark. **Examples:** \"https://www.example.com/\" or \"https://www.example.com/subsite/\" | |\n\nMethods\n-------\n\n\u003cbr /\u003e\n\nUse the [insert](/site-verification/v1/webResource/insert) method to verify the authenticated user's ownership of a website or domain. Use the [get](/site-verification/v1/webResource/get), [update](/site-verification/v1/webResource/update), and [delete](/site-verification/v1/webResource/delete) methods to retrieve or modify a resource that has already been verified for the authenticated user.\n\nYou can see all verified resources for the authenticated user with [list](/site-verification/v1/webResource/list), and you can get a token to place on the authenticated user's site with [getToken](/site-verification/v1/webResource/getToken).\n\n\u003cbr /\u003e\n\n[delete](/site-verification/v1/webResource/delete)\n: Unverifies the user's ownership of a website or domain.\n\n[get](/site-verification/v1/webResource/get)\n: Retrieves the most current data for a website or domain.\n\n[getToken](/site-verification/v1/webResource/getToken)\n: Gets a verification token for the authenticated user to place on a website or domain.\n\n[insert](/site-verification/v1/webResource/insert)\n: Verifies ownership of a website or domain.\n\n[list](/site-verification/v1/webResource/list)\n: Gets the list of the authenticated user's verified websites and domains.\n\n[update](/site-verification/v1/webResource/update)\n: Modifies the list of owners for a website or domain."]]