Enterprises: pullNotificationSet

  • TheEnterprises.PullNotificationSet method retrieves a set of notifications for associated enterprises.

  • Notification sets received must be acknowledged within 20 seconds usingEnterprises.AcknowledgeNotificationSet to avoid being resent or deleted.

  • Multiple concurrent requests are possible, with pending notifications split among callers.

  • An empty notification list is returned if no notifications are currently present, but subsequent requests may receive notifications when they become available.

Note:Requiresauthorization.

Pulls and returns a notification set for the enterprises associated withthe service account authenticated for the request. The notification set maybe empty if no notification are pending.
A notification set returned needs to be acknowledged within 20 secondsby calling Enterprises.AcknowledgeNotificationSet, unless thenotification set is empty.
Notifications that are not acknowledged within the 20 seconds willeventually be included again in the response to another PullNotificationSetrequest, and those that are never acknowledged will ultimately be deletedaccording to the Google Cloud Platform Pub/Sub system policy.
Multiple requests might be performed concurrently to retrievenotifications, in which case the pending notifications (if any) will besplit 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 becomeavailable.

Request

HTTP request

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

Parameters

Parameter nameValueDescription
Optional query parameters
requestModestring The request mode for pulling notifications.
SpecifyingwaitForNotifications will cause the request toblock and wait until one or more notifications are present, or return anempty notification list if no notifications are present after some time.
SpeciyingreturnImmediately will cause the request toimmediately return the pending notifications, or an empty list if nonotifications are present.
If omitted, defaults towaitForNotifications.

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 theauthentication 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}]}]}},"enterpriseUpgradeEvent":{"upgradeState":string}}]}
Property nameValueDescriptionNotes
notificationSetIdstringThe 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[]listThe notifications received, or empty if no notifications are present.
notification[].enterpriseIdstringThe ID of the enterprise for which the notification is sent. This will always be present.
notification[].timestampMillislongThe time when the notification was published in milliseconds since 1970-01-01T00:00:00Z. This will always be present.
notification[].productApprovalEventnested objectNotifications about changes to a product's approval status.
notification[].productApprovalEvent.productIdstringThe 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.approvedstringWhether the product was approved or unapproved. This field will always be present.

Acceptable values are:
  • "approved"
  • "unapproved"
  • "unknown"
notification[].installFailureEventnested objectNotifications about an app installation failure.
notification[].installFailureEvent.productIdstringThe 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.deviceIdstringThe Android ID of the device. This field will always be present.
notification[].installFailureEvent.userIdstringThe ID of the user. This field will always be present.
notification[].installFailureEvent.failureReasonstringThe reason for the installation failure. This field will always be present.

Acceptable values are:
  • "timeout"
  • "unknown"
notification[].installFailureEvent.failureDetailsstringAdditional details on the failure if applicable.
notification[].appUpdateEventnested objectNotifications about app updates.
notification[].appUpdateEvent.productIdstringThe id of the product (e.g. "app:com.google.android.gm") that was updated. This field will always be present.
notification[].newPermissionsEventnested objectNotifications about new app permissions.
notification[].newPermissionsEvent.productIdstringThe 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[]listThe 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[]listThe 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[].appRestrictionsSchemaChangeEventnested objectNotifications about new app restrictions schema changes.
notification[].appRestrictionsSchemaChangeEvent.productIdstringThe 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[].productAvailabilityChangeEventnested objectNotifications about product availability changes.
notification[].productAvailabilityChangeEvent.productIdstringThe 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.availabilityStatusstringThe new state of the product. This field will always be present.

Acceptable values are:
  • "available"
  • "removed"
  • "unknown"
  • "unpublished"
notification[].newDeviceEventnested objectNotifications about new devices.
notification[].newDeviceEvent.userIdstringThe ID of the user. This field will always be present.
notification[].newDeviceEvent.deviceIdstringThe Android ID of the device. This field will always be present.
notification[].newDeviceEvent.managementTypestringIdentifies 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[].notificationTypestringType of the notification.

Acceptable values are:
  • "appRestricionsSchemaChange"
  • "appUpdate"
  • "deviceReportUpdate"
  • "enterpriseUpgrade"
  • "installFailure"
  • "newDevice"
  • "newPermissions"
  • "productApproval"
  • "productAvailabilityChange"
  • "testNotification"
  • "unknown"
notification[].newDeviceEvent.dpcPackageNamestringPolicy app on the device.
notification[].deviceReportUpdateEventnested objectNotifications about device report updates.
notification[].deviceReportUpdateEvent.userIdstringThe ID of the user. This field will always be present.
notification[].deviceReportUpdateEvent.deviceIdstringThe Android ID of the device. This field will always be present.
notification[].deviceReportUpdateEvent.reportnested objectThe device report updated with the latest app states. This field will always be present.
notification[].deviceReportUpdateEvent.report.lastUpdatedTimestampMillislongThe timestamp of the last report update in milliseconds since epoch. This field will always be present.
notification[].deviceReportUpdateEvent.report.appState[]listList 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[].packageNamestringThe package name of the app. This field will always be present.
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[]listList of keyed app states. This field will always be present.
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].keystringKey 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[].stateTimestampMillislongTimestamp of when the app set the state in milliseconds since epoch. This field will always be present.
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].severitystringSeverity of the app state. This field will always be present.

Acceptable values are:
  • "severityError"
  • "severityInfo"
notification[].deviceReportUpdateEvent.report.appState[].keyedAppState[].messagestringFree-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[].datastringAdditional 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.
kindstring
notification[].enterpriseUpgradeEventnested objectNotifications about enterprise upgrade.
notification[].enterpriseUpgradeEvent.upgradeStatestringThe upgrade state.

Acceptable values are:
  • "upgradeStateSucceeded"
  • "upgradeStateUnspecified"

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-03-27 UTC.