POST https://graph.microsoft.com/v1.0/deviceManagement/deviceConfigurations
Content-type: application/json
Content-length: 279
{
"@odata.type": "#microsoft.graph.iosCustomConfiguration",
"description": "Description value",
"displayName": "Display Name value",
"version": 7,
"payloadName": "Payload Name value",
"payloadFileName": "Payload File Name value",
"payload": "cGF5bG9hZA=="
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new IosCustomConfiguration
{
OdataType = "#microsoft.graph.iosCustomConfiguration",
Description = "Description value",
DisplayName = "Display Name value",
Version = 7,
PayloadName = "Payload Name value",
PayloadFileName = "Payload File Name value",
Payload = Convert.FromBase64String("cGF5bG9hZA=="),
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.DeviceConfigurations.PostAsync(requestBody);
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc device-management device-configurations create --body '{\
"@odata.type": "#microsoft.graph.iosCustomConfiguration",\
"description": "Description value",\
"displayName": "Display Name value",\
"version": 7,\
"payloadName": "Payload Name value",\
"payloadFileName": "Payload File Name value",\
"payload": "cGF5bG9hZA=="\
}\
'
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
IosCustomConfiguration deviceConfiguration = new IosCustomConfiguration();
deviceConfiguration.setOdataType("#microsoft.graph.iosCustomConfiguration");
deviceConfiguration.setDescription("Description value");
deviceConfiguration.setDisplayName("Display Name value");
deviceConfiguration.setVersion(7);
deviceConfiguration.setPayloadName("Payload Name value");
deviceConfiguration.setPayloadFileName("Payload File Name value");
byte[] payload = Base64.getDecoder().decode("cGF5bG9hZA==");
deviceConfiguration.setPayload(payload);
DeviceConfiguration result = graphClient.deviceManagement().deviceConfigurations().post(deviceConfiguration);