Create mobileAppDependency

Namespace: microsoft.graph

Important: Microsoft Graph APIs under the /beta version are subject to change; production use is not supported.

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

Create a new mobileAppDependency object.

Prerequisites

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) DeviceManagementApps.ReadWrite.All
Delegated (personal Microsoft account) Not supported.
Application DeviceManagementApps.ReadWrite.All

HTTP Request

POST /deviceAppManagement/mobileApps/{mobileAppId}/relationships

Request headers

Header Value
Authorization Bearer <token> Required.
Accept application/json

Request body

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

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

Property Type Description
id String The relationship entity id. Inherited from mobileAppRelationship
targetId String The target mobile app's app id. Inherited from mobileAppRelationship
targetDisplayName String The target mobile app's display name. Inherited from mobileAppRelationship
targetDisplayVersion String The target mobile app's display version. Inherited from mobileAppRelationship
targetPublisher String The target mobile app's publisher. Inherited from mobileAppRelationship
targetType mobileAppRelationshipType The type of relationship indicating whether the target is a parent or child. Inherited from mobileAppRelationship. Possible values are: child, parent.
dependencyType mobileAppDependencyType The type of dependency relationship between the parent and child apps. Possible values are: detect, autoInstall.
dependentAppCount Int32 The total number of apps that directly or indirectly depend on the parent app.
dependsOnAppCount Int32 The total number of apps the child app directly or indirectly depends on.

Response

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

Example

Request

Here is an example of the request.

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

{
  "@odata.type": "#microsoft.graph.mobileAppDependency",
  "targetId": "Target Id value",
  "targetDisplayName": "Target Display Name value",
  "targetDisplayVersion": "Target Display Version value",
  "targetPublisher": "Target Publisher value",
  "targetType": "parent",
  "dependencyType": "autoInstall",
  "dependentAppCount": 1,
  "dependsOnAppCount": 1
}

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: 421

{
  "@odata.type": "#microsoft.graph.mobileAppDependency",
  "id": "c7f6f9ab-f9ab-c7f6-abf9-f6c7abf9f6c7",
  "targetId": "Target Id value",
  "targetDisplayName": "Target Display Name value",
  "targetDisplayVersion": "Target Display Version value",
  "targetPublisher": "Target Publisher value",
  "targetType": "parent",
  "dependencyType": "autoInstall",
  "dependentAppCount": 1,
  "dependsOnAppCount": 1
}