Chrome Policy API 總覽
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Chrome Policy API 是一套服務套件,可讓 Chrome 管理員以程式輔助方式,查看及管理貴機構中指派給機構單位的 Chrome 政策。透過這個 API,Chrome 管理員可在機構中使用 ChromeOS 裝置和 Chrome 瀏覽器的情形取得深入分析。
主要優點
Google 管理控制台相容性:透過 API 進行的變更會反映在 Google 管理控制台 UI 中,反之亦然。
稽核記錄:使用此 API 進行的變更會記錄在標準管理員稽核記錄中。
資料導向方法:Chrome 政策會以資料表示,而且不會由 API 介面直接參照,這樣一來,您就能將 API 用戶端自動化,方便日後使用未來的 Chrome 政策,無需額外開發。日後,透過 API 支援的政策數量將會增加。
與 Admin SDK API 相輔相成:這個 API 可與 Admin SDK API 相輔相成,因為 Chrome 管理員可以執行以下工作:
常見用途
下表列出您可以透過此 API 完成的常見工作。如要查看要求和回應範例,請前往程式碼範例。
網址是相對於 https://chromepolicy.googleapis.com/v1/customers/$CUSTOMER
的網址。
工作說明 |
相對網址 |
HTTP 方法 |
要求參數 |
列出政策結構定義 |
./policySchemas |
GET |
選用: filter 、pageSize 、pageToken |
取得政策結構定義 |
./policySchemas/$SCHEMA_NAME |
GET |
|
取得或列出機構單位或群組的政策 |
./policies:resolve |
POST |
必要: policySchemaFilter 、policyTargetKey
選用: pageSize 、pageToken
|
修改機構單位中的政策 |
./policies/orgunits:batchModify |
POST |
必要: requests: {policyTargetKey, policyValue, updateMask} |
沿用機構單位的政策 |
./policies/orgunits:batchInherit |
POST |
必要: requests: {policyTargetKey, policySchema} |
修改群組中的政策 |
./policies/groups:batchModify |
POST |
必要: requests: {policyTargetKey, policyValue, updateMask} |
刪除群組中的政策 |
./policies/groups:batchDelete |
POST |
必要: requests: {policyTargetKey, policySchema} |
列出群組中的優先順序 |
./policies/groups:listGroupPriorityOrdering |
POST |
必要: requests: {policyTargetKey, policyNamespace} |
更新群組中的優先順序 |
./policies/groups:updateGroupPriorityOrdering |
POST |
必要: requests: {policyTargetKey, policyNamespace, groupIds} |
根據政策上傳檔案 |
./policies/files:uploadPolicyFile |
POST |
必要: requests: {policyField} |
用量限制
這個 API 僅供 Chrome 客戶機構內部使用。詳情請參閱《Chrome Policy API 服務條款》。如要與 Google 合作建立商業 API 用戶端,請提出合作夥伴申請。
後續步驟
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eThe Chrome Policy API enables Chrome administrators to programmatically view and manage Chrome policies for their organization's ChromeOS devices and Chrome browsers.\u003c/p\u003e\n"],["\u003cp\u003eIt offers key benefits like Google Admin console compatibility, audit logging, and a data-driven approach for easier automation.\u003c/p\u003e\n"],["\u003cp\u003eAdmins can utilize this API to perform tasks such as listing policy schemas, retrieving specific schemas, and managing policies for organizational units and groups.\u003c/p\u003e\n"],["\u003cp\u003eUsage of this API is restricted to internal use within a Chrome customer's organization, with commercial partnerships requiring a separate application process.\u003c/p\u003e\n"],["\u003cp\u003eFurther exploration is encouraged through provided resources on policy schemas, request setup, and code samples.\u003c/p\u003e\n"]]],[],null,["# Chrome Policy API Overview\n\nThe Chrome Policy API is a suite of services that empower Chrome administrators\nto programmatically view and manage Chrome policies assigned to the\n[Organizational Units](https://support.google.com/a/answer/4352075)\nin their organization. With this API, Chrome admins can gain insights about how\nChromeOS devices and Chrome browsers are being used in their organization.\n\nKey advantages\n--------------\n\n- **Google Admin console compatibility:** Changes you make with the API are\n reflected in Google Admin console UI, and vice versa.\n\n- **Audit logging:** Changes made with this API are logged in the standard\n [Admin Audit logs](https://support.google.com/a/answer/4579579).\n\n- **Data-driven approach:** Chrome policies are represented as data and aren't\n directly referenced by the API interface. This lets you automate API clients\n for consumption of future Chrome policies without additional development. Over\n time, the number of policies supported via API will increase.\n\n- **Complements the Admin SDK API:** This API complements the Admin SDK API,\n where Chrome admins can perform the following tasks:\n\n - [Manage Chrome devices](/admin-sdk/directory/v1/guides/manage-chrome-devices) with the Admin SDK's Directory API.\n - [Manage Chrome browsers](https://support.google.com/chrome/a/answer/9681204) with the Admin SDK's Chrome Browser Management API.\n - [Manage Chrome CUPS printers](/admin-sdk/chrome-printer) with the Admin SDK's Chrome Printer Management API.\n\nPopular use cases\n-----------------\n\nThe table below lists the top tasks you can complete with this API. To review\nexample requests and responses, go to [Code samples](/chrome/policy/guides/samples_policyapi).\n\nURLs are relative to `https://chromepolicy.googleapis.com/v1/customers/`\u003cvar translate=\"no\"\u003e$CUSTOMER\u003c/var\u003e.\n\n| Task description | Relative URL | HTTP method | Request parameters |\n|--------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|-------------|-----------------------------------------------------------------------------------------|\n| [List policy schemas](/chrome/policy/reference/rest/v1/customers.policySchemas/list) | `./policySchemas` | `GET` | *Optional:* `filter`, `pageSize`, `pageToken` |\n| [Get a policy schema](/chrome/policy/reference/rest/v1/customers.policySchemas/get) | `./policySchemas/`\u003cvar translate=\"no\"\u003e$SCHEMA_NAME\u003c/var\u003e | `GET` | |\n| [Get or list policies for an Organizational Unit or Group](/chrome/policy/reference/rest/v1/customers.policies/resolve) | `./policies:resolve` | `POST` | *Required:* `policySchemaFilter`, `policyTargetKey` *Optional:* `pageSize`, `pageToken` |\n| [Modify policies in an Organizational Unit](/chrome/policy/reference/rest/v1/customers.policies.orgunits/batchModify) | `./policies/orgunits:batchModify` | `POST` | *Required:* `requests: {policyTargetKey, policyValue, updateMask}` |\n| [Inherit policies in an Organizational Unit](/chrome/policy/reference/rest/v1/customers.policies.orgunits/batchInherit) | `./policies/orgunits:batchInherit` | `POST` | *Required:* `requests: {policyTargetKey, policySchema}` |\n| [Modify policies in a Group](/chrome/policy/reference/rest/v1/customers.policies.groups/batchModify) | `./policies/groups:batchModify` | `POST` | *Required:* `requests: {policyTargetKey, policyValue, updateMask}` |\n| [Delete policies in a Group](/chrome/policy/reference/rest/v1/customers.policies.groups/batchDelete) | `./policies/groups:batchDelete` | `POST` | *Required:* `requests: {policyTargetKey, policySchema}` |\n| [List priority orderings in a Group](/chrome/policy/reference/rest/v1/customers.policies.groups/listGroupPriorityOrdering) | `./policies/groups:listGroupPriorityOrdering` | `POST` | *Required:* `requests: {policyTargetKey, policyNamespace}` |\n| [Update priority orderings in a Group](/chrome/policy/reference/rest/v1/customers.policies.groups/updateGroupPriorityOrdering) | `./policies/groups:updateGroupPriorityOrdering` | `POST` | *Required:* `requests: {policyTargetKey, policyNamespace, groupIds}` |\n| [Upload files for a policy](/chrome/policy/reference/rest/v1/media/upload) | `./policies/files:uploadPolicyFile` | `POST` | *Required:* `requests: {policyField}` |\n\nUsage limits\n------------\n\nThis API is only for use internally within a Chrome customer's organization. For more details, review the [Chrome Policy API Terms of Service](http://console.cloud.google.com/tos?id=chrome-policy). To build a commercial API client in partnership with Google, submit a [partner application](https://docs.google.com/forms/d/e/1FAIpQLSdJA-2_BZ3FJLSBtuWkPCMPXqUpxGbCta1wXRrrVdUCX7apog/viewform).\n\nNext steps\n----------\n\n- [Learn about policy schemas](./policy-schemas)\n- [Set up and authorize requests](./setup)\n- [Review code samples](./samples)"]]