API Reference

本 API 參考資料是依照資源類型編排。各個資源類型都具有一或多種資料表示法,以及一或多種方法。

資源類型

  1. 裝置
  2. Enterprises
  3. 授權
  4. Grouplicenses
  5. Grouplicenseusers
  6. 安裝次數
  7. Managedconfigurationsfordevice
  8. Managedconfigurationsforuser
  9. Managedconfigurationssettings
  10. 權限
  11. 產品
  12. Serviceaccountkeys
  13. Storelayoutclusters
  14. Storelayoutpages
  15. 使用者
  16. Webapps

裝置

如需 Devices 資源的詳細資料,請參閱「資源表示法」頁面。

方法 HTTP 要求 說明
除非另有說明,否則與 https://www.googleapis.com/androidenterprise/v1 相關的 URI
forceReportUpload POST  /enterprises/enterpriseId/users/userId/devices/deviceId/forceReportUpload 上傳報表,其中包含自上次產生報表以來,裝置上應用程式狀態的任何變更。您最多可針對特定裝置每 24 小時呼叫此方法 3 次。
get GET  /enterprises/enterpriseId/users/userId/devices/deviceId 擷取裝置的詳細資料。
getState GET  /enterprises/enterpriseId/users/userId/devices/deviceId/state 擷取裝置是否已啟用或停用 Google 服務存取權。只有在 Google 管理控制台中啟用在 Android 裝置上強制執行 EMM 政策的情況下,裝置狀態才會生效。否則,系統會忽略裝置狀態,並允許所有裝置存取 Google 服務。這項功能僅適用於 Google 管理的使用者。
list GET  /enterprises/enterpriseId/users/userId/devices 擷取使用者所有裝置的 ID。
setState PUT  /enterprises/enterpriseId/users/userId/devices/deviceId/state 設定裝置是否已啟用 Google 服務存取權。只有在 Google 管理控制台中啟用在 Android 裝置上強制執行 EMM 政策的情況下,裝置狀態才會生效。否則,系統會忽略裝置狀態,並允許所有裝置存取 Google 服務。這項功能僅適用於 Google 管理的使用者。
更新 PUT  /enterprises/enterpriseId/users/userId/devices/deviceId 更新裝置政策。

為確保政策能正確實施,您必須在 Google Play 套件的受管理設定中設定 allowed_accounts,以免未管理的帳戶存取 Google Play。請參閱「限制 Google Play 中的帳戶」一文。

企業

如需企業資源的詳細資料,請參閱「資源表示法」頁面。

方法 HTTP 要求 說明
除非另有說明,否則與 https://www.googleapis.com/androidenterprise/v1 相關的 URI
acknowledgeNotificationSet POST  /enterprises/acknowledgeNotificationSet 確認從 Enterprise.PullNotificationSet 收到的通知,以免後續呼叫傳回相同的通知。
completeSignup POST  /enterprises/completeSignup 指定完成權杖和企業權杖,完成註冊流程。請勿針對特定企業權杖多次呼叫這項要求。
createWebToken POST  /enterprises/enterpriseId/createWebToken 傳回用於存取可嵌入式 UI 的專屬權杖。如要產生網頁 UI,請將產生的權杖傳遞至受管理的 Google Play JavaScript API。每個符記只能用於啟動一個 UI 工作階段。詳情請參閱 JavaScript API 說明文件
註冊 POST  /enterprises/enroll 將企業註冊至呼叫的 EMM。

必要查詢參數: token

generateEnterpriseUpgradeUrl POST  /enterprises/enterpriseId/generateEnterpriseUpgradeUrl 產生企業升級網址,將現有的 Google Play 管理版帳戶企業升級為 Google 管理版網域。

generateSignupUrl POST  /enterprises/signupUrl 產生註冊網址。
get GET  /enterprises/enterpriseId 擷取企業的名稱和網域。
getServiceAccount GET  /enterprises/enterpriseId/serviceAccount 傳回服務帳戶和憑證。您可以呼叫 setAccount,將服務帳戶繫結至企業。服務帳戶是這家企業和 EMM 專屬,如果企業解除綁定,就會遭到刪除。憑證包含私密金鑰資料,不會儲存在伺服器端。

這個方法只能在呼叫 Enterprises.Enroll 或 Enterprises.CompleteSignup 後,以及 Enterprise.SetAccount 前呼叫;否則會傳回錯誤。

後續的後續呼叫會產生一組新的專屬憑證,並使先前產生的憑證失效。

服務帳戶一旦繫結至企業,即可使用 serviceAccountKeys 資源進行管理。

getStoreLayout GET  /enterprises/enterpriseId/storeLayout 傳回企業的商店版面配置。如果尚未設定商店版面配置,系統會傳回「基本」做為商店版面配置類型,且沒有首頁。
list GET  /enterprises 依據網域名稱查詢企業。這項功能僅適用於透過 Google 啟動的建立流程建立的企業。透過 EMM 啟動的流程建立的企業不需要查詢 ID,因為 EMM 會在 Enterprises.generateSignupUrl 呼叫中指定的回呼中取得企業 ID。

必要查詢參數: domain

pullNotificationSet POST  /enterprises/pullNotificationSet 針對與要求中驗證服務帳戶相關聯的企業,提取並傳回通知集。如果沒有待處理的通知,通知集可能會為空白。
除非通知集為空白,否則必須在 20 秒內呼叫 Enterprises.AcknowledgeNotificationSet,才能確認傳回的通知集。
未在 20 秒內確認的通知,最終會再次納入對另一個 PullNotificationSet 要求的回應中,而從未確認的通知,最終會根據 Google Cloud Platform Pub/Sub 系統政策刪除。
可能會同時執行多個要求來擷取通知,在這種情況下,如果有待處理的通知,則會在各個呼叫端之間分攤。
如果沒有通知,系統會傳回空的通知清單。後續要求可能會在可用時傳回更多通知。
sendTestPushNotification POST  /enterprises/enterpriseId/sendTestPushNotification 傳送測試通知,驗證 EMM 與此企業的 Google Cloud Pub/Sub 服務整合。
setAccount PUT  /enterprises/enterpriseId/account 設定要用於以企業身分驗證 API 的帳戶。
setStoreLayout PUT  /enterprises/enterpriseId/storeLayout 設定企業的商店版面配置。根據預設,storeLayoutType 會設為「basic」,並啟用基本商店版面配置。基本版版面配置只包含管理員核准的應用程式,且已加入使用者的可用產品集合 (使用 setAvailableProductSet 呼叫)。頁面上的應用程式會依產品 ID 值排序。如果您建立自訂商店版面配置 (透過設定 storeLayoutType = "custom" 並設定首頁),系統就會停用基本商店版面配置。
取消註冊 POST  /enterprises/enterpriseId/unenroll 從呼叫的 EMM 取消註冊企業。

授權

如需授權資源的詳細資料,請參閱「資源表示法」頁面。

方法 HTTP 要求 說明
除非另有說明,否則與 https://www.googleapis.com/androidenterprise/v1 相關的 URI
刪除 DELETE  /enterprises/enterpriseId/users/userId/entitlements/entitlementId 移除使用者對應用程式的授權。
get GET  /enterprises/enterpriseId/users/userId/entitlements/entitlementId 擷取授權的詳細資料。
list GET  /enterprises/enterpriseId/users/userId/entitlements 列出指定使用者的所有授權。只會設定 ID。
更新 PUT  /enterprises/enterpriseId/users/userId/entitlements/entitlementId 為使用者新增或更新應用程式授權。

Grouplicenses

如需 Grouplicenses 資源的詳細資料,請參閱「資源表示法」頁面。

方法 HTTP 要求 說明
除非另有說明,否則與 https://www.googleapis.com/androidenterprise/v1 相關的 URI
get GET  /enterprises/enterpriseId/groupLicenses/groupLicenseId 擷取企業針對產品的群組授權詳細資料。
list GET  /enterprises/enterpriseId/groupLicenses 擷取企業擁有群組授權的所有產品 ID。

Grouplicenseusers

如需 Grouplicenseusers 資源的詳細資料,請參閱「資源表示法」頁面。

方法 HTTP 要求 說明
除非另有說明,否則與 https://www.googleapis.com/androidenterprise/v1 相關的 URI
list GET  /enterprises/enterpriseId/groupLicenses/groupLicenseId/users 擷取已授予授權憑據權益的使用者 ID。

安裝

如需安裝資源的詳細資料,請參閱「資源表示法」頁面。

方法 HTTP 要求 說明
除非另有說明,否則與 https://www.googleapis.com/androidenterprise/v1 相關的 URI
刪除 DELETE  /enterprises/enterpriseId/users/userId/devices/deviceId/installs/installId 要求從裝置中移除應用程式。呼叫 getlist 時,系統仍會顯示應用程式已安裝在裝置上,直到應用程式實際移除為止。
get GET  /enterprises/enterpriseId/users/userId/devices/deviceId/installs/installId 擷取裝置上應用程式安裝作業的詳細資料。
list GET  /enterprises/enterpriseId/users/userId/devices/deviceId/installs 擷取指定裝置上安裝的所有應用程式詳細資料。
更新 PUT  /enterprises/enterpriseId/users/userId/devices/deviceId/installs/installId 要求在裝置上安裝應用程式的最新版本。如果應用程式已安裝,系統會視需要更新至最新版本。

Managedconfigurationsfordevice

如需 Managedconfigurationsfordevice 資源的詳細資料,請參閱「資源表示法」頁面。

方法 HTTP 要求 說明
除非另有說明,否則與 https://www.googleapis.com/androidenterprise/v1 相關的 URI
刪除 DELETE  /enterprises/enterpriseId/users/userId/devices/deviceId/managedConfigurationsForDevice/managedConfigurationForDeviceId 移除指定裝置上應用程式的個別裝置受管理設定。
get GET  /enterprises/enterpriseId/users/userId/devices/deviceId/managedConfigurationsForDevice/managedConfigurationForDeviceId 擷取個別裝置受管理設定的詳細資料。
list GET  /enterprises/enterpriseId/users/userId/devices/deviceId/managedConfigurationsForDevice 列出指定裝置的所有裝置層級管理設定。只會設定 ID。
更新 PUT  /enterprises/enterpriseId/users/userId/devices/deviceId/managedConfigurationsForDevice/managedConfigurationForDeviceId 為指定裝置的應用程式新增或更新個別裝置管理設定。

Managedconfigurationsforuser

如需 Managedconfigurationsforuser 資源的詳細資料,請參閱「資源表示法」頁面。

方法 HTTP 要求 說明
除非另有說明,否則與 https://www.googleapis.com/androidenterprise/v1 相關的 URI
刪除 DELETE  /enterprises/enterpriseId/users/userId/managedConfigurationsForUser/managedConfigurationForUserId 為指定使用者移除應用程式的個別使用者受管理設定。
get GET  /enterprises/enterpriseId/users/userId/managedConfigurationsForUser/managedConfigurationForUserId 針對指定使用者,擷取應用程式個別使用者管理設定的詳細資料。
list GET  /enterprises/enterpriseId/users/userId/managedConfigurationsForUser 列出指定使用者的所有個別使用者管理設定。只會設定 ID。
更新 PUT  /enterprises/enterpriseId/users/userId/managedConfigurationsForUser/managedConfigurationForUserId 為指定使用者新增或更新應用程式的受管理設定。如果您支援受管理的設定 iframe,您可以在要求中指定 mcmId 及其相關聯的設定變數 (如有),藉此為使用者套用受管理的設定。或者,所有 EMM 都可以透過傳遞受管理資源的清單,套用受管理的設定。

受管理的設定

如需 Managedconfigurationssettings 資源的詳細資料,請參閱「資源表示法」頁面。

方法 HTTP 要求 說明
除非另有說明,否則與 https://www.googleapis.com/androidenterprise/v1 相關的 URI
list GET  /enterprises/enterpriseId/products/productId/managedConfigurationsSettings 列出指定應用程式的所有受管理設定。

權限

如需權限資源的詳細資料,請參閱「資源表示法」頁面。

方法 HTTP 要求 說明
除非另有說明,否則與 https://www.googleapis.com/androidenterprise/v1 相關的 URI
get GET  /permissions/permissionId 擷取 Android 應用程式權限的詳細資料,供企業管理員查看。

產品

如需 Products 資源的詳細資料,請參閱「資源表示法」頁面。

方法 HTTP 要求 說明
除非另有說明,否則與 https://www.googleapis.com/androidenterprise/v1 相關的 URI
approve POST  /enterprises/enterpriseId/products/productId/approve

核准指定產品和相關應用程式權限 (如有)。每位企業客戶最多可核准 1,000 項產品。

如要瞭解如何使用 Google Play 管理版設計及建立商店版面配置,向使用者顯示核准的產品,請參閱「商店版面配置設計」。

generateApprovalUrl POST  /enterprises/enterpriseId/products/productId/generateApprovalUrl 產生可在 iframe 中算繪的網址,用於顯示產品的權限 (如果有的話)。企業管理員必須查看這些權限,並代表貴機構接受這些權限,才能核准該產品。

管理員應透過 EMM 主控台中的獨立 UI 元素進行互動,接受顯示的權限,這會觸發系統在 Products.approve 呼叫中使用此網址做為 approvalUrlInfo.approvalUrl 屬性,以便核准產品。這個網址只能用於顯示權限,最長為 1 天。
get GET  /enterprises/enterpriseId/products/productId 擷取產品詳細資料,供企業管理員查看。
getAppRestrictionsSchema GET  /enterprises/enterpriseId/products/productId/appRestrictionsSchema 擷取定義此產品可設定屬性的結構定義。所有產品都有結構定義,但如果未定義受管理的設定,這個結構定義可能會是空白。這個結構定義可用於填入 UI,讓系統管理員設定產品。如要根據使用此 API 取得的結構定義套用受管理的設定,請參閱「透過 Play 管理設定」。
getPermissions GET  /enterprises/enterpriseId/products/productId/permissions 擷取這個應用程式所需的 Android 應用程式權限。
list GET  /enterprises/enterpriseId/products 找出符合查詢的已核准產品,如果沒有查詢,則找出所有已核准的產品。
unapprove POST  /enterprises/enterpriseId/products/productId/unapprove 取消核准指定產品 (以及相關應用程式權限,如有)

Serviceaccountkeys

如需 Serviceaccountkeys 資源的詳細資料,請參閱「資源表示法」頁面。

方法 HTTP 要求 說明
除非另有說明,否則與 https://www.googleapis.com/androidenterprise/v1 相關的 URI
刪除 DELETE  /enterprises/enterpriseId/serviceAccountKeys/keyId 為與此企業相關聯的服務帳戶,移除並使指定憑證失效。呼叫服務帳戶必須透過呼叫 Enterprises.GetServiceAccount 擷取,並透過呼叫 Enterprises.SetAccount 設為企業服務帳戶。
插入 POST  /enterprises/enterpriseId/serviceAccountKeys 為與此企業相關聯的服務帳戶產生新的憑證。呼叫服務帳戶必須透過呼叫 Enterprises.GetServiceAccount 擷取,並透過呼叫 Enterprises.SetAccount 設為企業服務帳戶。

在要插入的資源中,只應填入鍵的類型。
list GET  /enterprises/enterpriseId/serviceAccountKeys 列出與此企業相關聯的服務帳戶的所有有效憑證。系統只會傳回 ID 和金鑰類型。呼叫服務帳戶必須透過呼叫 Enterprises.GetServiceAccount 擷取,並透過呼叫 Enterprises.SetAccount 設為企業服務帳戶。

Storelayoutclusters

如需 Storelayoutclusters 資源的詳細資料,請參閱「資源表示法」頁面。

方法 HTTP 要求 說明
除非另有說明,否則與 https://www.googleapis.com/androidenterprise/v1 相關的 URI
刪除 DELETE  /enterprises/enterpriseId/storeLayout/pages/pageId/clusters/clusterId 刪除叢集。
get GET  /enterprises/enterpriseId/storeLayout/pages/pageId/clusters/clusterId 擷取叢集的詳細資料。
插入 POST  /enterprises/enterpriseId/storeLayout/pages/pageId/clusters 在頁面中插入新叢集。
list GET  /enterprises/enterpriseId/storeLayout/pages/pageId/clusters 擷取指定網頁上所有叢集的詳細資料。
更新 PUT  /enterprises/enterpriseId/storeLayout/pages/pageId/clusters/clusterId 更新叢集。

Storelayoutpages

如需 Storelayoutpages 資源的詳細資料,請參閱「資源表示法」頁面。

方法 HTTP 要求 說明
除非另有說明,否則與 https://www.googleapis.com/androidenterprise/v1 相關的 URI
刪除 DELETE  /enterprises/enterpriseId/storeLayout/pages/pageId 刪除商店頁面。
get GET  /enterprises/enterpriseId/storeLayout/pages/pageId 擷取商店頁面的詳細資料。
插入 POST  /enterprises/enterpriseId/storeLayout/pages 插入新的商店頁面。
list GET  /enterprises/enterpriseId/storeLayout/pages 擷取商店中所有網頁的詳細資料。
更新 PUT  /enterprises/enterpriseId/storeLayout/pages/pageId 更新商店頁面內容。

使用者

如需 Users 資源的詳細資料,請參閱「資源表示法」頁面。

方法 HTTP 要求 說明
除非另有說明,否則與 https://www.googleapis.com/androidenterprise/v1 相關的 URI
刪除 DELETE  /enterprises/enterpriseId/users/userId 刪除由 EMM 管理的使用者。
generateAuthenticationToken POST  /enterprises/enterpriseId/users/userId/authenticationToken 產生驗證權杖,裝置政策用戶端可使用此權杖,在裝置上佈建特定的 EMM 管理使用者帳戶。產生的權杖為一次性使用,幾分鐘後就會失效。

每位使用者最多可佈建 10 部裝置。

這項呼叫僅適用於由 EMM 管理的帳戶。
get GET  /enterprises/enterpriseId/users/userId 擷取使用者詳細資料。
getAvailableProductSet GET  /enterprises/enterpriseId/users/userId/availableProductSet 擷取使用者有權存取的產品組合。
插入 POST  /enterprises/enterpriseId/users 建立新的 EMM 管理使用者。

在要求主體中傳遞的 Users 資源應包含 accountIdentifieraccountType

如果已存在對應的使用者,且使用者具有相同的帳戶 ID,系統會使用該資源更新使用者。在這種情況下,您只能變更 displayName 欄位。

list GET  /enterprises/enterpriseId/users 依主要電子郵件地址查詢使用者。這項功能僅適用於 Google 管理的使用者。對於由 EMM 管理的使用者,您不需要查詢 ID,因為 ID 已在 Users.insert 呼叫的結果中傳回。

必要查詢參數: email

revokeDeviceAccess DELETE  /enterprises/enterpriseId/users/userId/deviceAccess 撤銷使用者目前已佈建的所有裝置存取權。使用者將無法再透過任何受管理的裝置使用管理版 Play 商店。

這項呼叫僅適用於由 EMM 管理的帳戶。
setAvailableProductSet PUT  /enterprises/enterpriseId/users/userId/availableProductSet 修改使用者可存取的產品集合 (稱為許可清單產品)。只有已核准的產品,或先前核准的產品 (已撤銷核准的產品) 才能加入許可清單。
更新 PUT  /enterprises/enterpriseId/users/userId 更新 EMM 管理使用者的詳細資料。

僅適用於 EMM 管理的使用者 (不適用於 Google 管理的使用者)。 在要求主體中,傳遞「使用者」資源中的新詳細資料。您只能變更 displayName 欄位。其他欄位必須設為未設定或具有目前有效的值。

網頁應用程式

如需 Webapps 資源的詳細資料,請參閱「資源表示法」頁面。

方法 HTTP 要求 說明
除非另有說明,否則與 https://www.googleapis.com/androidenterprise/v1 相關的 URI
刪除 DELETE  /enterprises/enterpriseId/webApps/webAppId 刪除現有的網頁應用程式。
get GET  /enterprises/enterpriseId/webApps/webAppId 取得現有的網頁應用程式。
插入 POST  /enterprises/enterpriseId/webApps 為企業建立新的網頁應用程式。
list GET  /enterprises/enterpriseId/webApps 擷取指定企業的所有網頁應用程式詳細資料。
更新 PUT  /enterprises/enterpriseId/webApps/webAppId 更新現有的網頁應用程式。