Enterprises: pullNotificationSet

針對與要求中驗證服務帳戶相關聯的企業,提取並傳回通知集。如果沒有待處理的通知,通知集可能會為空白。
除非通知集為空白,否則必須在 20 秒內呼叫 Enterprises.AcknowledgeNotificationSet,才能確認傳回的通知集。
未在 20 秒內確認的通知,最終會再次納入對另一個 PullNotificationSet 要求的回應中,而從未確認的通知,最終會根據 Google Cloud Platform Pub/Sub 系統政策刪除。
可能會同時執行多個要求來擷取通知,在這種情況下,如果有待處理的通知,則會在各個呼叫端之間分攤。
如果沒有通知,系統會傳回空的通知清單。後續要求可能會在可用時傳回更多通知。

要求

HTTP 要求

POST https://www.googleapis.com/androidenterprise/v1/enterprises/pullNotificationSet

參數

參數名稱 說明
選用查詢參數
requestMode string 提取通知的要求模式。
指定 waitForNotifications 會導致要求封鎖,並等待出現一或多則通知,如果一段時間後沒有通知,則會傳回空白的通知清單。
指定 returnImmediately 會導致要求立即傳回待處理的通知,如果沒有通知,則會傳回空白清單。
如果省略,則預設為 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
                }
              ]
            }
          ]
        }
      },
      "enterpriseUpgradeEvent": {
        "upgradeState": string
      }
    }
  ]
}
屬性名稱 說明 附註
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 產品是否已獲核准。這個欄位一律會顯示。

可接受的值如下:
  • approved
  • unapproved
  • unknown
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 安裝失敗的原因。這個欄位一律會顯示。

可接受的值如下:
  • timeout
  • unknown
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 應用程式目前要求的權限組合。請使用 EMM API 中的 Permissions.Get,擷取這些權限的詳細資料。
notification[].newPermissionsEvent.approvedPermissions[] list 企業管理員已核准此應用程式的權限組合。請使用 EMM API 中的 Permissions.Get,擷取這些權限的詳細資料。
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 產品的新狀態。這個欄位一律會顯示。

可接受的值如下:
  • available
  • removed
  • unknown
  • unpublished
notification[].newDeviceEvent nested object 有關新裝置的通知。
notification[].newDeviceEvent.userId string 使用者的 ID。這個欄位一律會顯示。
notification[].newDeviceEvent.deviceId string 裝置的 Android ID。這個欄位一律會顯示。
notification[].newDeviceEvent.managementType string 在各種部署設定中,識別 Android EMM 對裝置的控制程度。

可能的值包括:
  • managedDevice」:DPC 設為裝置擁有者的裝置
  • managedProfile」:設定為設定檔擁有者的 DPC 裝置。


可接受的值如下:
  • managedDevice
  • managedProfile
notification[].notificationType string 通知類型。

可接受的值如下:
  • appRestricionsSchemaChange
  • appUpdate
  • deviceReportUpdate
  • enterpriseUpgrade
  • installFailure
  • newDevice
  • newPermissions
  • productApproval
  • productAvailabilityChange
  • testNotification
  • unknown
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 自 Epoch 紀元時間起算,上次報表更新的時間戳記 (以毫秒為單位)。這個欄位一律會顯示。
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 應用程式狀態的嚴重程度。這個欄位一律會顯示。

可接受的值如下:
  • severityError
  • severityInfo
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].message string 任意形式的使用者可讀訊息,用於說明應用程式狀態。例如錯誤訊息。為避免 XSS,建議您在顯示訊息前移除其中的任何 HTML。
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].data string 用於機器可讀資料的額外欄位。例如數字或 JSON 物件。為避免 XSS,建議您在顯示資料前先移除其中的任何 HTML。
kind string
notification[].enterpriseUpgradeEvent nested object 企業升級通知。
notification[].enterpriseUpgradeEvent.upgradeState string 升級狀態。

可接受的值如下:
  • upgradeStateSucceeded
  • upgradeStateUnspecified