One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
In the request body, supply a JSON representation for the macOSLobApp object.
The following table shows the properties that are required when you create the macOSLobApp.
Here is an example of the request.
POST https://graph.microsoft.com/v1.0/deviceAppManagement/mobileApps
Content-type: application/json
Content-length: 1523
{
"@odata.type": "#microsoft.graph.macOSLobApp",
"displayName": "Display Name value",
"description": "Description value",
"publisher": "Publisher value",
"largeIcon": {
"@odata.type": "microsoft.graph.mimeContent",
"type": "Type value",
"value": "dmFsdWU="
},
"isFeatured": true,
"privacyInformationUrl": "https://example.com/privacyInformationUrl/",
"informationUrl": "https://example.com/informationUrl/",
"owner": "Owner value",
"developer": "Developer value",
"notes": "Notes value",
"publishingState": "processing",
"committedContentVersion": "Committed Content Version value",
"fileName": "File Name value",
"size": 4,
"bundleId": "Bundle Id value",
"minimumSupportedOperatingSystem": {
"@odata.type": "microsoft.graph.macOSMinimumOperatingSystem",
"v10_7": true,
"v10_8": true,
"v10_9": true,
"v10_10": true,
"v10_11": true,
"v10_12": true,
"v10_13": true,
"v10_14": true,
"v10_15": true,
"v11_0": true,
"v12_0": true,
"v13_0": true
},
"buildNumber": "Build Number value",
"versionNumber": "Version Number value",
"childApps": [
{
"@odata.type": "microsoft.graph.macOSLobChildApp",
"bundleId": "Bundle Id value",
"buildNumber": "Build Number value",
"versionNumber": "Version Number value"
}
],
"md5HashChunkSize": 0,
"md5Hash": [
"Md5Hash value"
],
"ignoreVersionDetection": true,
"installAsManaged": true
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new MacOSLobApp
{
OdataType = "#microsoft.graph.macOSLobApp",
DisplayName = "Display Name value",
Description = "Description value",
Publisher = "Publisher value",
LargeIcon = new MimeContent
{
OdataType = "microsoft.graph.mimeContent",
Type = "Type value",
Value = Convert.FromBase64String("dmFsdWU="),
},
IsFeatured = true,
PrivacyInformationUrl = "https://example.com/privacyInformationUrl/",
InformationUrl = "https://example.com/informationUrl/",
Owner = "Owner value",
Developer = "Developer value",
Notes = "Notes value",
PublishingState = MobileAppPublishingState.Processing,
CommittedContentVersion = "Committed Content Version value",
FileName = "File Name value",
Size = 4L,
BundleId = "Bundle Id value",
MinimumSupportedOperatingSystem = new MacOSMinimumOperatingSystem
{
OdataType = "microsoft.graph.macOSMinimumOperatingSystem",
V107 = true,
V108 = true,
V109 = true,
V1010 = true,
V1011 = true,
V1012 = true,
V1013 = true,
V1014 = true,
V1015 = true,
V110 = true,
V120 = true,
V130 = true,
},
BuildNumber = "Build Number value",
VersionNumber = "Version Number value",
ChildApps = new List<MacOSLobChildApp>
{
new MacOSLobChildApp
{
OdataType = "microsoft.graph.macOSLobChildApp",
BundleId = "Bundle Id value",
BuildNumber = "Build Number value",
VersionNumber = "Version Number value",
},
},
Md5HashChunkSize = 0,
Md5Hash = new List<string>
{
"Md5Hash value",
},
IgnoreVersionDetection = true,
InstallAsManaged = true,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceAppManagement.MobileApps.PostAsync(requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
mgc device-app-management mobile-apps create --body '{\
"@odata.type": "#microsoft.graph.macOSLobApp",\
"displayName": "Display Name value",\
"description": "Description value",\
"publisher": "Publisher value",\
"largeIcon": {\
"@odata.type": "microsoft.graph.mimeContent",\
"type": "Type value",\
"value": "dmFsdWU="\
},\
"isFeatured": true,\
"privacyInformationUrl": "https://example.com/privacyInformationUrl/",\
"informationUrl": "https://example.com/informationUrl/",\
"owner": "Owner value",\
"developer": "Developer value",\
"notes": "Notes value",\
"publishingState": "processing",\
"committedContentVersion": "Committed Content Version value",\
"fileName": "File Name value",\
"size": 4,\
"bundleId": "Bundle Id value",\
"minimumSupportedOperatingSystem": {\
"@odata.type": "microsoft.graph.macOSMinimumOperatingSystem",\
"v10_7": true,\
"v10_8": true,\
"v10_9": true,\
"v10_10": true,\
"v10_11": true,\
"v10_12": true,\
"v10_13": true,\
"v10_14": true,\
"v10_15": true,\
"v11_0": true,\
"v12_0": true,\
"v13_0": true\
},\
"buildNumber": "Build Number value",\
"versionNumber": "Version Number value",\
"childApps": [\
{\
"@odata.type": "microsoft.graph.macOSLobChildApp",\
"bundleId": "Bundle Id value",\
"buildNumber": "Build Number value",\
"versionNumber": "Version Number value"\
}\
],\
"md5HashChunkSize": 0,\
"md5Hash": [\
"Md5Hash value"\
],\
"ignoreVersionDetection": true,\
"installAsManaged": true\
}\
'
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewMobileApp()
displayName := "Display Name value"
requestBody.SetDisplayName(&displayName)
description := "Description value"
requestBody.SetDescription(&description)
publisher := "Publisher value"
requestBody.SetPublisher(&publisher)
largeIcon := graphmodels.NewMimeContent()
type := "Type value"
largeIcon.SetType(&type)
value := []byte("dmFsdWU=")
largeIcon.SetValue(&value)
requestBody.SetLargeIcon(largeIcon)
isFeatured := true
requestBody.SetIsFeatured(&isFeatured)
privacyInformationUrl := "https://example.com/privacyInformationUrl/"
requestBody.SetPrivacyInformationUrl(&privacyInformationUrl)
informationUrl := "https://example.com/informationUrl/"
requestBody.SetInformationUrl(&informationUrl)
owner := "Owner value"
requestBody.SetOwner(&owner)
developer := "Developer value"
requestBody.SetDeveloper(&developer)
notes := "Notes value"
requestBody.SetNotes(¬es)
publishingState := graphmodels.PROCESSING_MOBILEAPPPUBLISHINGSTATE
requestBody.SetPublishingState(&publishingState)
committedContentVersion := "Committed Content Version value"
requestBody.SetCommittedContentVersion(&committedContentVersion)
fileName := "File Name value"
requestBody.SetFileName(&fileName)
size := int64(4)
requestBody.SetSize(&size)
bundleId := "Bundle Id value"
requestBody.SetBundleId(&bundleId)
minimumSupportedOperatingSystem := graphmodels.NewMacOSMinimumOperatingSystem()
v10_7 := true
minimumSupportedOperatingSystem.SetV10_7(&v10_7)
v10_8 := true
minimumSupportedOperatingSystem.SetV10_8(&v10_8)
v10_9 := true
minimumSupportedOperatingSystem.SetV10_9(&v10_9)
v10_10 := true
minimumSupportedOperatingSystem.SetV10_10(&v10_10)
v10_11 := true
minimumSupportedOperatingSystem.SetV10_11(&v10_11)
v10_12 := true
minimumSupportedOperatingSystem.SetV10_12(&v10_12)
v10_13 := true
minimumSupportedOperatingSystem.SetV10_13(&v10_13)
v10_14 := true
minimumSupportedOperatingSystem.SetV10_14(&v10_14)
v10_15 := true
minimumSupportedOperatingSystem.SetV10_15(&v10_15)
v11_0 := true
minimumSupportedOperatingSystem.SetV11_0(&v11_0)
v12_0 := true
minimumSupportedOperatingSystem.SetV12_0(&v12_0)
v13_0 := true
minimumSupportedOperatingSystem.SetV13_0(&v13_0)
requestBody.SetMinimumSupportedOperatingSystem(minimumSupportedOperatingSystem)
buildNumber := "Build Number value"
requestBody.SetBuildNumber(&buildNumber)
versionNumber := "Version Number value"
requestBody.SetVersionNumber(&versionNumber)
macOSLobChildApp := graphmodels.NewMacOSLobChildApp()
bundleId := "Bundle Id value"
macOSLobChildApp.SetBundleId(&bundleId)
buildNumber := "Build Number value"
macOSLobChildApp.SetBuildNumber(&buildNumber)
versionNumber := "Version Number value"
macOSLobChildApp.SetVersionNumber(&versionNumber)
childApps := []graphmodels.MacOSLobChildAppable {
macOSLobChildApp,
}
requestBody.SetChildApps(childApps)
md5HashChunkSize := int32(0)
requestBody.SetMd5HashChunkSize(&md5HashChunkSize)
md5Hash := []string {
"Md5Hash value",
}
requestBody.SetMd5Hash(md5Hash)
ignoreVersionDetection := true
requestBody.SetIgnoreVersionDetection(&ignoreVersionDetection)
installAsManaged := true
requestBody.SetInstallAsManaged(&installAsManaged)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
mobileApps, err := graphClient.DeviceAppManagement().MobileApps().Post(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
MacOSLobApp mobileApp = new MacOSLobApp();
mobileApp.setOdataType("#microsoft.graph.macOSLobApp");
mobileApp.setDisplayName("Display Name value");
mobileApp.setDescription("Description value");
mobileApp.setPublisher("Publisher value");
MimeContent largeIcon = new MimeContent();
largeIcon.setOdataType("microsoft.graph.mimeContent");
largeIcon.setType("Type value");
byte[] value = Base64.getDecoder().decode("dmFsdWU=");
largeIcon.setValue(value);
mobileApp.setLargeIcon(largeIcon);
mobileApp.setIsFeatured(true);
mobileApp.setPrivacyInformationUrl("https://example.com/privacyInformationUrl/");
mobileApp.setInformationUrl("https://example.com/informationUrl/");
mobileApp.setOwner("Owner value");
mobileApp.setDeveloper("Developer value");
mobileApp.setNotes("Notes value");
mobileApp.setPublishingState(MobileAppPublishingState.Processing);
mobileApp.setCommittedContentVersion("Committed Content Version value");
mobileApp.setFileName("File Name value");
mobileApp.setSize(4L);
mobileApp.setBundleId("Bundle Id value");
MacOSMinimumOperatingSystem minimumSupportedOperatingSystem = new MacOSMinimumOperatingSystem();
minimumSupportedOperatingSystem.setOdataType("microsoft.graph.macOSMinimumOperatingSystem");
minimumSupportedOperatingSystem.setV107(true);
minimumSupportedOperatingSystem.setV108(true);
minimumSupportedOperatingSystem.setV109(true);
minimumSupportedOperatingSystem.setV1010(true);
minimumSupportedOperatingSystem.setV1011(true);
minimumSupportedOperatingSystem.setV1012(true);
minimumSupportedOperatingSystem.setV1013(true);
minimumSupportedOperatingSystem.setV1014(true);
minimumSupportedOperatingSystem.setV1015(true);
minimumSupportedOperatingSystem.setV110(true);
minimumSupportedOperatingSystem.setV120(true);
minimumSupportedOperatingSystem.setV130(true);
mobileApp.setMinimumSupportedOperatingSystem(minimumSupportedOperatingSystem);
mobileApp.setBuildNumber("Build Number value");
mobileApp.setVersionNumber("Version Number value");
LinkedList<MacOSLobChildApp> childApps = new LinkedList<MacOSLobChildApp>();
MacOSLobChildApp macOSLobChildApp = new MacOSLobChildApp();
macOSLobChildApp.setOdataType("microsoft.graph.macOSLobChildApp");
macOSLobChildApp.setBundleId("Bundle Id value");
macOSLobChildApp.setBuildNumber("Build Number value");
macOSLobChildApp.setVersionNumber("Version Number value");
childApps.add(macOSLobChildApp);
mobileApp.setChildApps(childApps);
mobileApp.setMd5HashChunkSize(0);
LinkedList<String> md5Hash = new LinkedList<String>();
md5Hash.add("Md5Hash value");
mobileApp.setMd5Hash(md5Hash);
mobileApp.setIgnoreVersionDetection(true);
mobileApp.setInstallAsManaged(true);
MobileApp result = graphClient.deviceAppManagement().mobileApps().post(mobileApp);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
const options = {
authProvider,
};
const client = Client.init(options);
const mobileApp = {
'@odata.type': '#microsoft.graph.macOSLobApp',
displayName: 'Display Name value',
description: 'Description value',
publisher: 'Publisher value',
largeIcon: {
'@odata.type': 'microsoft.graph.mimeContent',
type: 'Type value',
value: 'dmFsdWU='
},
isFeatured: true,
privacyInformationUrl: 'https://example.com/privacyInformationUrl/',
informationUrl: 'https://example.com/informationUrl/',
owner: 'Owner value',
developer: 'Developer value',
notes: 'Notes value',
publishingState: 'processing',
committedContentVersion: 'Committed Content Version value',
fileName: 'File Name value',
size: 4,
bundleId: 'Bundle Id value',
minimumSupportedOperatingSystem: {
'@odata.type': 'microsoft.graph.macOSMinimumOperatingSystem',
v10_7: true,
v10_8: true,
v10_9: true,
v10_10: true,
v10_11: true,
v10_12: true,
v10_13: true,
v10_14: true,
v10_15: true,
v11_0: true,
v12_0: true,
v13_0: true
},
buildNumber: 'Build Number value',
versionNumber: 'Version Number value',
childApps: [
{
'@odata.type': 'microsoft.graph.macOSLobChildApp',
bundleId: 'Bundle Id value',
buildNumber: 'Build Number value',
versionNumber: 'Version Number value'
}
],
md5HashChunkSize: 0,
md5Hash: [
'Md5Hash value'
],
ignoreVersionDetection: true,
installAsManaged: true
};
await client.api('/deviceAppManagement/mobileApps')
.post(mobileApp);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\MacOSLobApp;
use Microsoft\Graph\Generated\Models\MimeContent;
use Microsoft\Graph\Generated\Models\MobileAppPublishingState;
use Microsoft\Graph\Generated\Models\MacOSMinimumOperatingSystem;
use Microsoft\Graph\Generated\Models\MacOSLobChildApp;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new MacOSLobApp();
$requestBody->setOdataType('#microsoft.graph.macOSLobApp');
$requestBody->setDisplayName('Display Name value');
$requestBody->setDescription('Description value');
$requestBody->setPublisher('Publisher value');
$largeIcon = new MimeContent();
$largeIcon->setOdataType('microsoft.graph.mimeContent');
$largeIcon->setType('Type value');
$largeIcon->setValue(\GuzzleHttp\Psr7\Utils::streamFor(base64_decode('dmFsdWU=')));
$requestBody->setLargeIcon($largeIcon);
$requestBody->setIsFeatured(true);
$requestBody->setPrivacyInformationUrl('https://example.com/privacyInformationUrl/');
$requestBody->setInformationUrl('https://example.com/informationUrl/');
$requestBody->setOwner('Owner value');
$requestBody->setDeveloper('Developer value');
$requestBody->setNotes('Notes value');
$requestBody->setPublishingState(new MobileAppPublishingState('processing'));
$requestBody->setCommittedContentVersion('Committed Content Version value');
$requestBody->setFileName('File Name value');
$requestBody->setSize(4);
$requestBody->setBundleId('Bundle Id value');
$minimumSupportedOperatingSystem = new MacOSMinimumOperatingSystem();
$minimumSupportedOperatingSystem->setOdataType('microsoft.graph.macOSMinimumOperatingSystem');
$minimumSupportedOperatingSystem->setV107(true);
$minimumSupportedOperatingSystem->setV108(true);
$minimumSupportedOperatingSystem->setV109(true);
$minimumSupportedOperatingSystem->setV1010(true);
$minimumSupportedOperatingSystem->setV1011(true);
$minimumSupportedOperatingSystem->setV1012(true);
$minimumSupportedOperatingSystem->setV1013(true);
$minimumSupportedOperatingSystem->setV1014(true);
$minimumSupportedOperatingSystem->setV1015(true);
$minimumSupportedOperatingSystem->setV110(true);
$minimumSupportedOperatingSystem->setV120(true);
$minimumSupportedOperatingSystem->setV130(true);
$requestBody->setMinimumSupportedOperatingSystem($minimumSupportedOperatingSystem);
$requestBody->setBuildNumber('Build Number value');
$requestBody->setVersionNumber('Version Number value');
$childAppsMacOSLobChildApp1 = new MacOSLobChildApp();
$childAppsMacOSLobChildApp1->setOdataType('microsoft.graph.macOSLobChildApp');
$childAppsMacOSLobChildApp1->setBundleId('Bundle Id value');
$childAppsMacOSLobChildApp1->setBuildNumber('Build Number value');
$childAppsMacOSLobChildApp1->setVersionNumber('Version Number value');
$childAppsArray []= $childAppsMacOSLobChildApp1;
$requestBody->setChildApps($childAppsArray);
$requestBody->setMd5HashChunkSize(0);
$requestBody->setMd5Hash(['Md5Hash value', ]);
$requestBody->setIgnoreVersionDetection(true);
$requestBody->setInstallAsManaged(true);
$result = $graphServiceClient->deviceAppManagement()->mobileApps()->post($requestBody)->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Import-Module Microsoft.Graph.Devices.CorporateManagement
$params = @{
"@odata.type" = "#microsoft.graph.macOSLobApp"
displayName = "Display Name value"
description = "Description value"
publisher = "Publisher value"
largeIcon = @{
"@odata.type" = "microsoft.graph.mimeContent"
type = "Type value"
value = [System.Text.Encoding]::ASCII.GetBytes("dmFsdWU=")
}
isFeatured = $true
privacyInformationUrl = "https://example.com/privacyInformationUrl/"
informationUrl = "https://example.com/informationUrl/"
owner = "Owner value"
developer = "Developer value"
notes = "Notes value"
publishingState = "processing"
committedContentVersion = "Committed Content Version value"
fileName = "File Name value"
size =
bundleId = "Bundle Id value"
minimumSupportedOperatingSystem = @{
"@odata.type" = "microsoft.graph.macOSMinimumOperatingSystem"
v10_7 = $true
v10_8 = $true
v10_9 = $true
v10_10 = $true
v10_11 = $true
v10_12 = $true
v10_13 = $true
v10_14 = $true
v10_15 = $true
v11_0 = $true
v12_0 = $true
v13_0 = $true
}
buildNumber = "Build Number value"
versionNumber = "Version Number value"
childApps = @(
@{
"@odata.type" = "microsoft.graph.macOSLobChildApp"
bundleId = "Bundle Id value"
buildNumber = "Build Number value"
versionNumber = "Version Number value"
}
)
md5HashChunkSize =
md5Hash = @(
"Md5Hash value"
)
ignoreVersionDetection = $true
installAsManaged = $true
}
New-MgDeviceAppManagementMobileApp -BodyParameter $params
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.mac_o_s_lob_app import MacOSLobApp
from msgraph.generated.models.mime_content import MimeContent
from msgraph.generated.models.mobile_app_publishing_state import MobileAppPublishingState
from msgraph.generated.models.mac_o_s_minimum_operating_system import MacOSMinimumOperatingSystem
from msgraph.generated.models.mac_o_s_lob_child_app import MacOSLobChildApp
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = MacOSLobApp(
odata_type = "#microsoft.graph.macOSLobApp",
display_name = "Display Name value",
description = "Description value",
publisher = "Publisher value",
large_icon = MimeContent(
odata_type = "microsoft.graph.mimeContent",
type = "Type value",
value = base64.urlsafe_b64decode("dmFsdWU="),
),
is_featured = True,
privacy_information_url = "https://example.com/privacyInformationUrl/",
information_url = "https://example.com/informationUrl/",
owner = "Owner value",
developer = "Developer value",
notes = "Notes value",
publishing_state = MobileAppPublishingState.Processing,
committed_content_version = "Committed Content Version value",
file_name = "File Name value",
size = 4,
bundle_id = "Bundle Id value",
minimum_supported_operating_system = MacOSMinimumOperatingSystem(
odata_type = "microsoft.graph.macOSMinimumOperatingSystem",
v10_7 = True,
v10_8 = True,
v10_9 = True,
v10_10 = True,
v10_11 = True,
v10_12 = True,
v10_13 = True,
v10_14 = True,
v10_15 = True,
v11_0 = True,
v12_0 = True,
v13_0 = True,
),
build_number = "Build Number value",
version_number = "Version Number value",
child_apps = [
MacOSLobChildApp(
odata_type = "microsoft.graph.macOSLobChildApp",
bundle_id = "Bundle Id value",
build_number = "Build Number value",
version_number = "Version Number value",
),
],
md5_hash_chunk_size = 0,
md5_hash = [
"Md5Hash value",
],
ignore_version_detection = True,
install_as_managed = True,
)
result = await graph_client.device_app_management.mobile_apps.post(request_body)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
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.