// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new IosMobileAppConfiguration
{
OdataType = "#microsoft.graph.iosMobileAppConfiguration",
TargetedMobileApps = new List<string>
{
"Targeted Mobile Apps value",
},
Description = "Description value",
DisplayName = "Display Name value",
Version = 7,
EncodedSettingXml = Convert.FromBase64String("ZW5jb2RlZFNldHRpbmdYbWw="),
Settings = new List<AppConfigurationSettingItem>
{
new AppConfigurationSettingItem
{
OdataType = "microsoft.graph.appConfigurationSettingItem",
AppConfigKey = "App Config Key value",
AppConfigKeyType = MdmAppConfigKeyType.IntegerType,
AppConfigKeyValue = "App Config Key Value 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.MobileAppConfigurations.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
IosMobileAppConfiguration managedDeviceMobileAppConfiguration = new IosMobileAppConfiguration();
managedDeviceMobileAppConfiguration.setOdataType("#microsoft.graph.iosMobileAppConfiguration");
LinkedList<String> targetedMobileApps = new LinkedList<String>();
targetedMobileApps.add("Targeted Mobile Apps value");
managedDeviceMobileAppConfiguration.setTargetedMobileApps(targetedMobileApps);
managedDeviceMobileAppConfiguration.setDescription("Description value");
managedDeviceMobileAppConfiguration.setDisplayName("Display Name value");
managedDeviceMobileAppConfiguration.setVersion(7);
byte[] encodedSettingXml = Base64.getDecoder().decode("ZW5jb2RlZFNldHRpbmdYbWw=");
managedDeviceMobileAppConfiguration.setEncodedSettingXml(encodedSettingXml);
LinkedList<AppConfigurationSettingItem> settings = new LinkedList<AppConfigurationSettingItem>();
AppConfigurationSettingItem appConfigurationSettingItem = new AppConfigurationSettingItem();
appConfigurationSettingItem.setOdataType("microsoft.graph.appConfigurationSettingItem");
appConfigurationSettingItem.setAppConfigKey("App Config Key value");
appConfigurationSettingItem.setAppConfigKeyType(MdmAppConfigKeyType.IntegerType);
appConfigurationSettingItem.setAppConfigKeyValue("App Config Key Value value");
settings.add(appConfigurationSettingItem);
managedDeviceMobileAppConfiguration.setSettings(settings);
ManagedDeviceMobileAppConfiguration result = graphClient.deviceAppManagement().mobileAppConfigurations().post(managedDeviceMobileAppConfiguration);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.ios_mobile_app_configuration import IosMobileAppConfiguration
from msgraph.generated.models.app_configuration_setting_item import AppConfigurationSettingItem
from msgraph.generated.models.mdm_app_config_key_type import MdmAppConfigKeyType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = IosMobileAppConfiguration(
odata_type = "#microsoft.graph.iosMobileAppConfiguration",
targeted_mobile_apps = [
"Targeted Mobile Apps value",
],
description = "Description value",
display_name = "Display Name value",
version = 7,
encoded_setting_xml = base64.urlsafe_b64decode("ZW5jb2RlZFNldHRpbmdYbWw="),
settings = [
AppConfigurationSettingItem(
odata_type = "microsoft.graph.appConfigurationSettingItem",
app_config_key = "App Config Key value",
app_config_key_type = MdmAppConfigKeyType.IntegerType,
app_config_key_value = "App Config Key Value value",
),
],
)
result = await graph_client.device_app_management.mobile_app_configurations.post(request_body)
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.