針對與要求經過驗證的服務帳戶相關聯的企業,擷取並傳回通知集。如果沒有任何通知,則通知集可留空。
除非通知集為空白,否則傳回的通知集必須在 20 秒內呼叫 Enterprises.AcknowledgeNotificationSet 進行確認。
若未在 20 秒內確認,系統最後會再次納入回應,以回應其他 DrawNotificationSet 要求;最後,系統將根據 Google Cloud Platform Pub/Sub 的系統政策,刪除尚未確認的通知。
可以同時執行多個要求以擷取通知,在此情況下,待處理的通知 (如果有) 將會分給每個呼叫者 (如果有)。
如果沒有通知,則會傳回空白的通知清單。
後續要求可在可用後傳回更多通知。
要求
HTTP 要求
POST https://www.googleapis.com/androidenterprise/v1/enterprises/pullNotificationSet
參數
參數名稱 | 值 | 說明 |
---|---|---|
選用查詢參數 | ||
requestMode |
string |
提取通知的要求模式。 指定 waitForNotifications 會導致要求遭到封鎖,並等待一或多則通知出現;如果經過一段時間後沒有任何通知,則會傳回空白的通知清單。指定 returnImmediately 將導致要求立即傳回待處理的通知,如果沒有任何通知,則會傳回空白清單。
如果省略,預設值為 waitForNotifications 。
可接受的值如下:
|
授權
此要求需要以下範圍的授權:
範圍 |
---|
https://www.googleapis.com/auth/androidenterprise |
詳情請參閱驗證和授權頁面。
要求主體
請不要透過此方法提供請求主體。
回應
如果成功的話,這個方法會傳回回應內文,其結構如下:
{ "kind": "androidenterprise#notificationSet", "notificationSetId": string, "notification": [ { "enterpriseId": string, "timestampMillis": long, "notificationType": string, "productApprovalEvent": { "productId": string, "approved": string }, "installFailureEvent": { "productId": string, "deviceId": string, "userId": string, "failureReason": string, "failureDetails": string }, "appUpdateEvent": { "productId": string }, "newPermissionsEvent": { "productId": string, "requestedPermissions": [ string ], "approvedPermissions": [ string ] }, "appRestrictionsSchemaChangeEvent": { "productId": string }, "productAvailabilityChangeEvent": { "productId": string, "availabilityStatus": string }, "newDeviceEvent": { "userId": string, "deviceId": string, "managementType": string, "dpcPackageName": string }, "deviceReportUpdateEvent": { "userId": string, "deviceId": string, "report": { "lastUpdatedTimestampMillis": long, "appState": [ { "packageName": string, "keyedAppState": [ { "key": string, "stateTimestampMillis": long, "severity": string, "message": string, "data": string } ] } ] } } } ] }
屬性名稱 | 值 | 說明 | Notes |
---|---|---|---|
notificationSetId |
string |
通知集 ID;這是使用 Enterprises.AcknowledgeNotification API 標示通知所需的項目。如果沒有任何通知,系統會省略這個欄位。 | |
notification[] |
list |
收到的通知,如果沒有任何通知,則為空白。 | |
notification[].enterpriseId |
string |
傳送通知的所屬企業 ID。這會始終存在。 | |
notification[].timestampMillis |
long |
自 1970-01-01T00:00:00Z 起,通知以毫秒為單位發布的通知。這會始終存在。 | |
notification[].productApprovalEvent |
nested object |
產品核准狀態變更的通知。 | |
notification[].productApprovalEvent.productId |
string |
核准狀態變更的產品 ID (例如「app:com.google.android.gm」)。這個欄位會一律顯示。 | |
notification[].productApprovalEvent.approved |
string |
產品是否已獲得核准或未獲核准。這個欄位會一律顯示。 可接受的值如下:
|
|
notification[].installFailureEvent |
nested object |
應用程式安裝失敗通知。 | |
notification[].installFailureEvent.productId |
string |
發生安裝失敗事件的產品 ID (例如「app:com.google.android.gm」)。這個欄位會一律顯示。 | |
notification[].installFailureEvent.deviceId |
string |
裝置的 Android ID。這個欄位會一律顯示。 | |
notification[].installFailureEvent.userId |
string |
使用者的 ID。這個欄位會一律顯示。 | |
notification[].installFailureEvent.failureReason |
string |
安裝失敗的原因。這個欄位會一律顯示。 可接受的值如下:
|
|
notification[].installFailureEvent.failureDetails |
string |
失敗的詳細資訊 (如適用)。 | |
notification[].appUpdateEvent |
nested object |
應用程式更新的通知。 | |
notification[].appUpdateEvent.productId |
string |
已更新的產品 ID (例如「app:com.google.android.gm」)。這個欄位會一律顯示。 | |
notification[].newPermissionsEvent |
nested object |
新應用程式權限的通知。 | |
notification[].newPermissionsEvent.productId |
string |
新增權限的產品 ID (例如「app:com.google.android.gm」)。這個欄位會一律顯示。 | |
notification[].newPermissionsEvent.requestedPermissions[] |
list |
應用程式目前要求的權限組合。使用 Permissions。在 EMM API 上取得這些權限的詳細資料。 | |
notification[].newPermissionsEvent.approvedPermissions[] |
list |
企業管理員已核准此應用程式的權限組合。使用 Permissions。在 EMM API 上取得這些權限的詳細資料。 | |
notification[].appRestrictionsSchemaChangeEvent |
nested object |
新的應用程式限制結構定義變更通知。 | |
notification[].appRestrictionsSchemaChangeEvent.productId |
string |
應用程式限制結構定義已變更的產品 ID (例如「app:com.google.android.gm」)。這個欄位會一律顯示。 | |
notification[].productAvailabilityChangeEvent |
nested object |
產品供應情形異動通知。 | |
notification[].productAvailabilityChangeEvent.productId |
string |
產品供應情形變更的產品 ID (例如「app:com.google.android.gm」)。這個欄位會一律顯示。 | |
notification[].productAvailabilityChangeEvent.availabilityStatus |
string |
產品的新狀態。這個欄位會一律顯示。 可接受的值如下:
|
|
notification[].newDeviceEvent |
nested object |
新裝置通知。 | |
notification[].newDeviceEvent.userId |
string |
使用者的 ID。這個欄位會一律顯示。 | |
notification[].newDeviceEvent.deviceId |
string |
裝置的 Android ID。這個欄位會一律顯示。 | |
notification[].newDeviceEvent.managementType |
string |
指出 Android EMM 在各種部署設定中控制裝置的範圍。 可能的值包括:
可接受的值如下:
|
|
notification[].notificationType |
string |
通知類型。
可接受的值如下:
|
|
notification[].newDeviceEvent.dpcPackageName |
string |
裝置上的政策應用程式。 | |
notification[].deviceReportUpdateEvent |
nested object |
裝置報告更新通知。 | |
notification[].deviceReportUpdateEvent.userId |
string |
使用者的 ID。這個欄位會一律顯示。 | |
notification[].deviceReportUpdateEvent.deviceId |
string |
裝置的 Android ID。這個欄位會一律顯示。 | |
notification[].deviceReportUpdateEvent.report |
nested object |
裝置報告已更新為最新的應用程式狀態。這個欄位會一律顯示。 | |
notification[].deviceReportUpdateEvent.report.lastUpdatedTimestampMillis |
long |
上次回報時間 (自毫秒起算) 的時間戳記 (以毫秒為單位)。這個欄位會一律顯示。 | |
notification[].deviceReportUpdateEvent.report.appState[] |
list |
裝置上受管理應用程式所設定的應用程式狀態清單。應用程式狀態是由應用程式開發人員所定義。這個欄位會一律顯示。 | |
notification[].deviceReportUpdateEvent.report.appState[].packageName |
string |
應用程式的套件名稱。這個欄位一律會顯示。 | |
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[] |
list |
金鑰應用程式狀態清單。這個欄位會一律顯示。 | |
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].key |
string |
表示應用程式提供狀態的金鑰。金鑰內容是由應用程式開發人員設定,為了避免 XSS,建議您在顯示金鑰之前先移除金鑰中的任何 HTML。這個欄位會一律顯示。 | |
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].stateTimestampMillis |
long |
應用程式自 Epoch 紀元時間以來設定狀態的時間戳記 (以毫秒為單位)。這個欄位會一律顯示。 | |
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].severity |
string |
應用程式狀態的嚴重性。這個欄位會一律顯示。 可接受的值如下:
|
|
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].message |
string |
使用者可理解的任意形式訊息,用於說明應用程式狀態。例如錯誤訊息。為了避免 XSS,建議您在顯示訊息之前先移除訊息中的所有 HTML。 | |
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].data |
string |
供機器可讀資料的其他欄位。例如數字或 JSON 物件。為了避免 XSS,建議您在顯示資料之前,先移除資料中所有的 HTML。 | |
kind |
string |