Edit

Create deviceAndAppManagementDeploymentAssignment

Namespace: microsoft.graph

Important: Microsoft supports Intune /beta APIs, but they are subject to more frequent change. Microsoft recommends using version v1.0 when possible. Check an API's availability in version v1.0 using the Version selector.

Note: The Microsoft Graph API for Intune requires an active Intune license for the tenant.

Create a new deviceAndAppManagementDeploymentAssignment object.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) DeviceManagementConfiguration.ReadWrite.All, DeviceManagementApps.ReadWrite.All
Delegated (personal Microsoft account) Not supported.
Application DeviceManagementConfiguration.ReadWrite.All, DeviceManagementApps.ReadWrite.All

HTTP Request

POST /deviceAppManagement/mobileApps/{mobileAppId}/targetAssignments

Request headers

Header Value
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Accept application/json

Request body

In the request body, supply a JSON representation for the deviceAndAppManagementDeploymentAssignment object.

The following table shows the properties that are required when you create the deviceAndAppManagementDeploymentAssignment.

Property Type Description
id String The unique identifier for this assignment. Returned by default. This property is read-only. Inherited from deviceAndAppManagementPayloadAssignment
payloadId String The unique identifier (Guid) for the payload associated with this assignment. Returned by default. Inherited from deviceAndAppManagementPayloadAssignment
target deviceAndAppManagementAssignmentTarget The target group for this assignment. This value will be supplied on write operation only for direct/policy set assignments. This value will not be supplied on write operation for deployment assignments. However, it is populated when reading any assignment. Inherited from deviceAndAppManagementPayloadAssignment
assignmentDetail deviceAndAppManagementAssignmentDetail Type encapsulating additional properties for an assignment except for assignment target (group, assignment filter, identifier information). Inherited from deviceAndAppManagementPayloadAssignment
referenceAssignmentId String The unique identifier (Guid) of the reference assignment in the deployment. This identifier is generated by server side on deployment creation for each instance of assignment in a ring and is referenced when configuring deployment payload assignments. Returned by default.
deploymentId String The unique identifier (Guid) of the deployment from which this assignment is sourced. Returned by default. This property is read-only.

Response

If successful, this method returns a 201 Created response code and a deviceAndAppManagementDeploymentAssignment object in the response body.

Example

Request

Here is an example of the request.

POST https://graph.microsoft.com/beta/deviceAppManagement/mobileApps/{mobileAppId}/targetAssignments
Content-type: application/json
Content-length: 1210

{
  "@odata.type": "#microsoft.graph.deviceAndAppManagementDeploymentAssignment",
  "payloadId": "Payload Id value",
  "target": {
    "@odata.type": "microsoft.graph.allLicensedUsersAssignmentTarget",
    "deviceAndAppManagementAssignmentFilterId": "Device And App Management Assignment Filter Id value",
    "deviceAndAppManagementAssignmentFilterType": "include"
  },
  "assignmentDetail": {
    "@odata.type": "microsoft.graph.mobileAppAssignmentDetail",
    "intent": "requiredUninstall",
    "settings": {
      "@odata.type": "microsoft.graph.winGetAppAssignmentSettings",
      "notifications": "showReboot",
      "restartSettings": {
        "@odata.type": "microsoft.graph.winGetAppRestartSettings",
        "gracePeriodInMinutes": 4,
        "countdownDisplayBeforeRestartInMinutes": 6,
        "restartNotificationSnoozeDurationInMinutes": 10
      },
      "installTimeSettings": {
        "@odata.type": "microsoft.graph.winGetAppInstallTimeSettings",
        "useLocalTime": true,
        "deadlineDateTime": "2017-01-01T00:00:21.0378955-08:00"
      }
    }
  },
  "referenceAssignmentId": "Reference Assignment Id value",
  "deploymentId": "Deployment Id value"
}

Response

Here is an example of the response. Note: The response object shown here may be truncated for brevity. All of the properties will be returned from an actual call.

HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 1259

{
  "@odata.type": "#microsoft.graph.deviceAndAppManagementDeploymentAssignment",
  "id": "ed77bfc2-bfc2-ed77-c2bf-77edc2bf77ed",
  "payloadId": "Payload Id value",
  "target": {
    "@odata.type": "microsoft.graph.allLicensedUsersAssignmentTarget",
    "deviceAndAppManagementAssignmentFilterId": "Device And App Management Assignment Filter Id value",
    "deviceAndAppManagementAssignmentFilterType": "include"
  },
  "assignmentDetail": {
    "@odata.type": "microsoft.graph.mobileAppAssignmentDetail",
    "intent": "requiredUninstall",
    "settings": {
      "@odata.type": "microsoft.graph.winGetAppAssignmentSettings",
      "notifications": "showReboot",
      "restartSettings": {
        "@odata.type": "microsoft.graph.winGetAppRestartSettings",
        "gracePeriodInMinutes": 4,
        "countdownDisplayBeforeRestartInMinutes": 6,
        "restartNotificationSnoozeDurationInMinutes": 10
      },
      "installTimeSettings": {
        "@odata.type": "microsoft.graph.winGetAppInstallTimeSettings",
        "useLocalTime": true,
        "deadlineDateTime": "2017-01-01T00:00:21.0378955-08:00"
      }
    }
  },
  "referenceAssignmentId": "Reference Assignment Id value",
  "deploymentId": "Deployment Id value"
}