Create microsoftStoreForBusinessApp
Article 08/01/2024
13 contributors
Feedback
In this article
Namespace: microsoft.graph
Note: The Microsoft Graph API for Intune requires an active Intune license for the tenant.
Create a new microsoftStoreForBusinessApp 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)
DeviceManagementApps.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Application
DeviceManagementApps.ReadWrite.All
HTTP Request
POST /deviceAppManagement/mobileApps
Request body
In the request body, supply a JSON representation for the microsoftStoreForBusinessApp object.
The following table shows the properties that are required when you create the microsoftStoreForBusinessApp.
Property
Type
Description
id
String
Key of the entity. Inherited from mobileApp
displayName
String
The admin provided or imported title of the app. Inherited from mobileApp
description
String
The description of the app. Inherited from mobileApp
publisher
String
The publisher of the app. Inherited from mobileApp
largeIcon
mimeContent
The large icon, to be displayed in the app details and used for upload of the icon. Inherited from mobileApp
createdDateTime
DateTimeOffset
The date and time the app was created. Inherited from mobileApp
lastModifiedDateTime
DateTimeOffset
The date and time the app was last modified. Inherited from mobileApp
isFeatured
Boolean
The value indicating whether the app is marked as featured by the admin. Inherited from mobileApp
privacyInformationUrl
String
The privacy statement Url. Inherited from mobileApp
informationUrl
String
The more information Url. Inherited from mobileApp
owner
String
The owner of the app. Inherited from mobileApp
developer
String
The developer of the app. Inherited from mobileApp
notes
String
Notes for the app. Inherited from mobileApp
publishingState
mobileAppPublishingState
The publishing state for the app. The app cannot be assigned unless the app is published. Inherited from mobileApp . Possible values are: notPublished
, processing
, published
.
usedLicenseCount
Int32
The number of Microsoft Store for Business licenses in use.
totalLicenseCount
Int32
The total number of Microsoft Store for Business licenses.
productKey
String
The app product key
licenseType
microsoftStoreForBusinessLicenseType
The app license type. Possible values are: offline
, online
.
packageIdentityName
String
The app package identifier
Response
If successful, this method returns a 201 Created
response code and a microsoftStoreForBusinessApp object in the response body.
Example
Request
Here is an example of the request.
POST https://graph.microsoft.com/v1.0/deviceAppManagement/mobileApps
Content-type: application/json
Content-length: 769
{
"@odata.type": "#microsoft.graph.microsoftStoreForBusinessApp",
"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",
"usedLicenseCount": 0,
"totalLicenseCount": 1,
"productKey": "Product Key value",
"licenseType": "online",
"packageIdentityName": "Package Identity Name value"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new MicrosoftStoreForBusinessApp
{
OdataType = "#microsoft.graph.microsoftStoreForBusinessApp",
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,
UsedLicenseCount = 0,
TotalLicenseCount = 1,
ProductKey = "Product Key value",
LicenseType = MicrosoftStoreForBusinessLicenseType.Online,
PackageIdentityName = "Package Identity Name value",
};
// 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.microsoftStoreForBusinessApp",\
"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",\
"usedLicenseCount": 0,\
"totalLicenseCount": 1,\
"productKey": "Product Key value",\
"licenseType": "online",\
"packageIdentityName": "Package Identity Name value"\
}\
'
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)
usedLicenseCount := int32(0)
requestBody.SetUsedLicenseCount(&usedLicenseCount)
totalLicenseCount := int32(1)
requestBody.SetTotalLicenseCount(&totalLicenseCount)
productKey := "Product Key value"
requestBody.SetProductKey(&productKey)
licenseType := graphmodels.ONLINE_MICROSOFTSTOREFORBUSINESSLICENSETYPE
requestBody.SetLicenseType(&licenseType)
packageIdentityName := "Package Identity Name value"
requestBody.SetPackageIdentityName(&packageIdentityName)
// 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);
MicrosoftStoreForBusinessApp mobileApp = new MicrosoftStoreForBusinessApp();
mobileApp.setOdataType("#microsoft.graph.microsoftStoreForBusinessApp");
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.setUsedLicenseCount(0);
mobileApp.setTotalLicenseCount(1);
mobileApp.setProductKey("Product Key value");
mobileApp.setLicenseType(MicrosoftStoreForBusinessLicenseType.Online);
mobileApp.setPackageIdentityName("Package Identity Name value");
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.microsoftStoreForBusinessApp',
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',
usedLicenseCount: 0,
totalLicenseCount: 1,
productKey: 'Product Key value',
licenseType: 'online',
packageIdentityName: 'Package Identity Name value'
};
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\MicrosoftStoreForBusinessApp;
use Microsoft\Graph\Generated\Models\MimeContent;
use Microsoft\Graph\Generated\Models\MobileAppPublishingState;
use Microsoft\Graph\Generated\Models\MicrosoftStoreForBusinessLicenseType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new MicrosoftStoreForBusinessApp();
$requestBody->setOdataType('#microsoft.graph.microsoftStoreForBusinessApp');
$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->setUsedLicenseCount(0);
$requestBody->setTotalLicenseCount(1);
$requestBody->setProductKey('Product Key value');
$requestBody->setLicenseType(new MicrosoftStoreForBusinessLicenseType('online'));
$requestBody->setPackageIdentityName('Package Identity Name value');
$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.microsoftStoreForBusinessApp"
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"
usedLicenseCount =
totalLicenseCount =
productKey = "Product Key value"
licenseType = "online"
packageIdentityName = "Package Identity Name value"
}
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.microsoft_store_for_business_app import MicrosoftStoreForBusinessApp
from msgraph.generated.models.mime_content import MimeContent
from msgraph.generated.models.mobile_app_publishing_state import MobileAppPublishingState
from msgraph.generated.models.microsoft_store_for_business_license_type import MicrosoftStoreForBusinessLicenseType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = MicrosoftStoreForBusinessApp(
odata_type = "#microsoft.graph.microsoftStoreForBusinessApp",
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,
used_license_count = 0,
total_license_count = 1,
product_key = "Product Key value",
license_type = MicrosoftStoreForBusinessLicenseType.Online,
package_identity_name = "Package Identity Name value",
)
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 .
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: 941
{
"@odata.type": "#microsoft.graph.microsoftStoreForBusinessApp",
"id": "f33358bc-58bc-f333-bc58-33f3bc5833f3",
"displayName": "Display Name value",
"description": "Description value",
"publisher": "Publisher value",
"largeIcon": {
"@odata.type": "microsoft.graph.mimeContent",
"type": "Type value",
"value": "dmFsdWU="
},
"createdDateTime": "2017-01-01T00:02:43.5775965-08:00",
"lastModifiedDateTime": "2017-01-01T00:00:35.1329464-08:00",
"isFeatured": true,
"privacyInformationUrl": "https://example.com/privacyInformationUrl/",
"informationUrl": "https://example.com/informationUrl/",
"owner": "Owner value",
"developer": "Developer value",
"notes": "Notes value",
"publishingState": "processing",
"usedLicenseCount": 0,
"totalLicenseCount": 1,
"productKey": "Product Key value",
"licenseType": "online",
"packageIdentityName": "Package Identity Name value"
}