Update

Updates the device policy

30 variables
26 variables

Updates the device policy

Authorization

To use this building block you will have to grant access to at least one of the following scopes:

  • Manage corporate Android devices

Input

This building block consumes 30 input parameters

  = Parameter name
  = Format

enterpriseId STRING Required

The ID of the enterprise

userId STRING Required

The ID of the user

deviceId STRING Required

The ID of the device

updateMask STRING

Mask that identifies which fields to update. If not set, all modifiable fields will be modified.

When set in a query parameter, this field should be specified as updateMask=,,..

androidId STRING

The Google Play Services Android ID for the device encoded as a lowercase hex string. For example, "123456789abcdef0"

kind STRING

Identifies what kind of resource this is. Value: the fixed string "androidenterprise#device"

managementType STRING

Identifies the extent to which the device is controlled by a managed Google Play EMM in various deployment configurations.

Possible values include:

  • "managedDevice", a device that has the EMM's device policy controller (DPC) as the device owner.
  • "managedProfile", a device that has a profile managed by the DPC (DPC is profile owner) in addition to a separate, personal profile that is unavailable to the DPC.
  • "containerApp", no longer used (deprecated).
  • "unmanagedProfile", a device that has been allowed (by the domain's admin, using the Admin Console to enable the privilege) to use managed Google Play, but the profile is itself not owned by a DPC.

policy OBJECT

The device policy for a given managed device

policy.autoUpdatePolicy STRING

The auto-update policy for apps installed on the device. "choiceToTheUser" allows the device's user to configure the app update policy. "always" enables auto updates. "never" disables auto updates. "wifiOnly" enables auto updates only when the device is connected to wifi

policy.deviceReportPolicy STRING

Whether the device reports app states to the EMM. The default value is "deviceReportDisabled"

policy.maintenanceWindow OBJECT

Maintenance window for managed Google Play Accounts. This allows Play store to update the apps on the foreground in the designated window

policy.maintenanceWindow.durationMs INTEGER

Duration of the maintenance window, in milliseconds. The duration must be between 30 minutes and 24 hours (inclusive)

policy.maintenanceWindow.startTimeAfterMidnightMs INTEGER

Start time of the maintenance window, in milliseconds after midnight on the device. Windows can span midnight

policy.productAvailabilityPolicy STRING

The availability granted to the device for the specified products. "all" gives the device access to all products, regardless of approval status. "all" does not enable automatic visibility of "alpha" or "beta" tracks. "whitelist" grants the device access the products specified in productPolicy[]. Only products that are approved or products that were previously approved (products with revoked approval) by the enterprise can be whitelisted. If no value is provided, the availability set at the user level is applied by default

policy.productPolicy[] OBJECT

The policy for a product

policy.productPolicy[].autoInstallPolicy OBJECT

policy.productPolicy[].autoInstallPolicy.autoInstallMode STRING

The auto-install mode. If unset defaults to "doNotAutoInstall"

policy.productPolicy[].autoInstallPolicy.autoInstallPriority INTEGER

The priority of the install, as an unsigned integer. A lower number means higher priority

policy.productPolicy[].autoInstallPolicy.minimumVersionCode INTEGER

The minimum version of the app. If a lower version of the app is installed, then the app will be auto-updated according to the auto-install constraints, instead of waiting for the regular auto-update

policy.productPolicy[].managedConfiguration OBJECT

A managed configuration resource contains the set of managed properties defined by the app developer in the app's managed configurations schema, as well as any configuration variables defined for the user

policy.productPolicy[].managedConfiguration.kind STRING

Identifies what kind of resource this is. Value: the fixed string "androidenterprise#managedConfiguration"

policy.productPolicy[].managedConfiguration.productId STRING

The ID of the product that the managed configuration is for, e.g. "app:com.google.android.gm"

policy.productPolicy[].productId STRING

The ID of the product. For example, "app:com.google.android.gm"

policy.productPolicy[].trackIds[] STRING

policy.productPolicy[].tracks[] STRING

report OBJECT

Device report updated with the latest app states for managed apps on the device

report.appState[] OBJECT

List of states set by the app

report.appState[].keyedAppState[] OBJECT

Represents a keyed app state containing a key, timestamp, severity level, optional description, and optional data

report.appState[].packageName STRING

The package name of the app. This field will always be present

report.lastUpdatedTimestampMillis INTEGER

The timestamp of the last report update in milliseconds since epoch. This field will always be present

Output

This building block provides 26 output parameters

  = Parameter name
  = Format

androidId STRING

The Google Play Services Android ID for the device encoded as a lowercase hex string. For example, "123456789abcdef0"

kind STRING

Identifies what kind of resource this is. Value: the fixed string "androidenterprise#device"

managementType STRING

Identifies the extent to which the device is controlled by a managed Google Play EMM in various deployment configurations.

Possible values include:

  • "managedDevice", a device that has the EMM's device policy controller (DPC) as the device owner.
  • "managedProfile", a device that has a profile managed by the DPC (DPC is profile owner) in addition to a separate, personal profile that is unavailable to the DPC.
  • "containerApp", no longer used (deprecated).
  • "unmanagedProfile", a device that has been allowed (by the domain's admin, using the Admin Console to enable the privilege) to use managed Google Play, but the profile is itself not owned by a DPC.

policy OBJECT

The device policy for a given managed device

policy.autoUpdatePolicy STRING

The auto-update policy for apps installed on the device. "choiceToTheUser" allows the device's user to configure the app update policy. "always" enables auto updates. "never" disables auto updates. "wifiOnly" enables auto updates only when the device is connected to wifi

policy.deviceReportPolicy STRING

Whether the device reports app states to the EMM. The default value is "deviceReportDisabled"

policy.maintenanceWindow OBJECT

Maintenance window for managed Google Play Accounts. This allows Play store to update the apps on the foreground in the designated window

policy.maintenanceWindow.durationMs INTEGER

Duration of the maintenance window, in milliseconds. The duration must be between 30 minutes and 24 hours (inclusive)

policy.maintenanceWindow.startTimeAfterMidnightMs INTEGER

Start time of the maintenance window, in milliseconds after midnight on the device. Windows can span midnight

policy.productAvailabilityPolicy STRING

The availability granted to the device for the specified products. "all" gives the device access to all products, regardless of approval status. "all" does not enable automatic visibility of "alpha" or "beta" tracks. "whitelist" grants the device access the products specified in productPolicy[]. Only products that are approved or products that were previously approved (products with revoked approval) by the enterprise can be whitelisted. If no value is provided, the availability set at the user level is applied by default

policy.productPolicy[] OBJECT

The policy for a product

policy.productPolicy[].autoInstallPolicy OBJECT

policy.productPolicy[].autoInstallPolicy.autoInstallMode STRING

The auto-install mode. If unset defaults to "doNotAutoInstall"

policy.productPolicy[].autoInstallPolicy.autoInstallPriority INTEGER

The priority of the install, as an unsigned integer. A lower number means higher priority

policy.productPolicy[].autoInstallPolicy.minimumVersionCode INTEGER

The minimum version of the app. If a lower version of the app is installed, then the app will be auto-updated according to the auto-install constraints, instead of waiting for the regular auto-update

policy.productPolicy[].managedConfiguration OBJECT

A managed configuration resource contains the set of managed properties defined by the app developer in the app's managed configurations schema, as well as any configuration variables defined for the user

policy.productPolicy[].managedConfiguration.kind STRING

Identifies what kind of resource this is. Value: the fixed string "androidenterprise#managedConfiguration"

policy.productPolicy[].managedConfiguration.productId STRING

The ID of the product that the managed configuration is for, e.g. "app:com.google.android.gm"

policy.productPolicy[].productId STRING

The ID of the product. For example, "app:com.google.android.gm"

policy.productPolicy[].trackIds[] STRING

policy.productPolicy[].tracks[] STRING

report OBJECT

Device report updated with the latest app states for managed apps on the device

report.appState[] OBJECT

List of states set by the app

report.appState[].keyedAppState[] OBJECT

Represents a keyed app state containing a key, timestamp, severity level, optional description, and optional data

report.appState[].packageName STRING

The package name of the app. This field will always be present

report.lastUpdatedTimestampMillis INTEGER

The timestamp of the last report update in milliseconds since epoch. This field will always be present