Enterprises: pullNotificationSet

Pulls and returns a notification set for the enterprises associated with the service account authenticated for the request. The notification set may be empty if no notification are pending.
A notification set returned needs to be acknowledged within 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless the notification set is empty.
Notifications that are not acknowledged within the 20 seconds will eventually be included again in the response to another PullNotificationSet request, and those that are never acknowledged will ultimately be deleted according to the Google Cloud Platform Pub/Sub system policy.
Multiple requests might be performed concurrently to retrieve notifications, in which case the pending notifications (if any) will be split among each caller, if any are pending.
If no notifications are present, an empty notification list is returned. Subsequent requests may return more notifications once they become available.

Request

HTTP request

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

Parameters

Parameter name Value Description
Optional query parameters
requestMode string The request mode for pulling notifications.
Specifying waitForNotifications will cause the request to block and wait until one or more notifications are present, or return an empty notification list if no notifications are present after some time.
Speciying returnImmediately will cause the request to immediately return the pending notifications, or an empty list if no notifications are present.
If omitted, defaults to waitForNotifications.

Acceptable values are:
  • "returnImmediately"
  • "waitForNotifications"

Authorization

This request requires authorization with the following scope:

Scope
https://www.googleapis.com/auth/androidenterprise

For more information, see the authentication and authorization page.

Request body

Do not supply a request body with this method.

Response

If successful, this method returns a response body with the following structure:

{
  "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
                }
              ]
            }
          ]
        }
      }
    }
  ]
}
Property name Value Description Notes
notificationSetId string The notification set ID, required to mark the notification as received with the Enterprises.AcknowledgeNotification API. This will be omitted if no notifications are present.
notification[] list The notifications received, or empty if no notifications are present.
notification[].enterpriseId string The ID of the enterprise for which the notification is sent. This will always be present.
notification[].timestampMillis long The time when the notification was published in milliseconds since 1970-01-01T00:00:00Z. This will always be present.
notification[].productApprovalEvent nested object Notifications about changes to a product's approval status.
notification[].productApprovalEvent.productId string The id of the product (e.g. "app:com.google.android.gm") for which the approval status has changed. This field will always be present.
notification[].productApprovalEvent.approved string Whether the product was approved or unapproved. This field will always be present.

Acceptable values are:
  • "approved"
  • "unapproved"
  • "unknown"
notification[].installFailureEvent nested object Notifications about an app installation failure.
notification[].installFailureEvent.productId string The id of the product (e.g. "app:com.google.android.gm") for which the install failure event occured. This field will always be present.
notification[].installFailureEvent.deviceId string The Android ID of the device. This field will always be present.
notification[].installFailureEvent.userId string The ID of the user. This field will always be present.
notification[].installFailureEvent.failureReason string The reason for the installation failure. This field will always be present.

Acceptable values are:
  • "timeout"
  • "unknown"
notification[].installFailureEvent.failureDetails string Additional details on the failure if applicable.
notification[].appUpdateEvent nested object Notifications about app updates.
notification[].appUpdateEvent.productId string The id of the product (e.g. "app:com.google.android.gm") that was updated. This field will always be present.
notification[].newPermissionsEvent nested object Notifications about new app permissions.
notification[].newPermissionsEvent.productId string The id of the product (e.g. "app:com.google.android.gm") for which new permissions were added. This field will always be present.
notification[].newPermissionsEvent.requestedPermissions[] list The set of permissions that the app is currently requesting. Use Permissions.Get on the EMM API to retrieve details about these permissions.
notification[].newPermissionsEvent.approvedPermissions[] list The set of permissions that the enterprise admin has already approved for this application. Use Permissions.Get on the EMM API to retrieve details about these permissions.
notification[].appRestrictionsSchemaChangeEvent nested object Notifications about new app restrictions schema changes.
notification[].appRestrictionsSchemaChangeEvent.productId string The id of the product (e.g. "app:com.google.android.gm") for which the app restriction schema changed. This field will always be present.
notification[].productAvailabilityChangeEvent nested object Notifications about product availability changes.
notification[].productAvailabilityChangeEvent.productId string The id of the product (e.g. "app:com.google.android.gm") for which the product availability changed. This field will always be present.
notification[].productAvailabilityChangeEvent.availabilityStatus string The new state of the product. This field will always be present.

Acceptable values are:
  • "available"
  • "removed"
  • "unknown"
  • "unpublished"
notification[].newDeviceEvent nested object Notifications about new devices.
notification[].newDeviceEvent.userId string The ID of the user. This field will always be present.
notification[].newDeviceEvent.deviceId string The Android ID of the device. This field will always be present.
notification[].newDeviceEvent.managementType string Identifies the extent to which the device is controlled by an Android EMM in various deployment configurations.

Possible values include:
  • "managedDevice", a device where the DPC is set as device owner,
  • "managedProfile", a device where the DPC is set as profile owner.


Acceptable values are:
  • "managedDevice"
  • "managedProfile"
notification[].notificationType string Type of the notification.

Acceptable values are:
  • "appRestricionsSchemaChange"
  • "appUpdate"
  • "deviceReportUpdate"
  • "installFailure"
  • "newDevice"
  • "newPermissions"
  • "productApproval"
  • "productAvailabilityChange"
  • "testNotification"
  • "unknown"
notification[].newDeviceEvent.dpcPackageName string Policy app on the device.
notification[].deviceReportUpdateEvent nested object Notifications about device report updates.
notification[].deviceReportUpdateEvent.userId string The ID of the user. This field will always be present.
notification[].deviceReportUpdateEvent.deviceId string The Android ID of the device. This field will always be present.
notification[].deviceReportUpdateEvent.report nested object The device report updated with the latest app states. This field will always be present.
notification[].deviceReportUpdateEvent.report.lastUpdatedTimestampMillis long The timestamp of the last report update in milliseconds since epoch. This field will always be present.
notification[].deviceReportUpdateEvent.report.appState[] list List of app states set by managed apps on the device. App states are defined by the app's developers. This field will always be present.
notification[].deviceReportUpdateEvent.report.appState[].packageName string The package name of the app. This field will always be present.
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[] list List of keyed app states. This field will always be present.
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].key string Key indicating what the app is providing a state for. The content of the key is set by the app's developer. To prevent XSS, we recommend removing any HTML from the key before displaying it. This field will always be present.
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].stateTimestampMillis long Timestamp of when the app set the state in milliseconds since epoch. This field will always be present.
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].severity string Severity of the app state. This field will always be present.

Acceptable values are:
  • "severityError"
  • "severityInfo"
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].message string Free-form, human-readable message describing the app state. For example, an error message. To prevent XSS, we recommend removing any HTML from the message before displaying it.
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].data string Additional field intended for machine-readable data. For example, a number or JSON object. To prevent XSS, we recommend removing any HTML from the data before displaying it.
kind string