APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Beta.Models.IndustryData.SourceSystemDefinition
{
DisplayName = "Rostering source",
UserMatchingSettings = new List<Microsoft.Graph.Beta.Models.IndustryData.UserMatchingSetting>
{
new Microsoft.Graph.Beta.Models.IndustryData.UserMatchingSetting
{
MatchTarget = new Microsoft.Graph.Beta.Models.IndustryData.UserMatchTargetReferenceValue
{
Code = "userPrincipalName",
},
PriorityOrder = 0,
SourceIdentifier = new Microsoft.Graph.Beta.Models.IndustryData.IdentifierTypeReferenceValue
{
Code = "username",
},
AdditionalData = new Dictionary<string, object>
{
{
"roleGroup@odata.bind" , "https://graph.microsoft.com/beta/external/industryData/roleGroups/staff"
},
},
},
new Microsoft.Graph.Beta.Models.IndustryData.UserMatchingSetting
{
MatchTarget = new Microsoft.Graph.Beta.Models.IndustryData.UserMatchTargetReferenceValue
{
Code = "userPrincipalName",
},
PriorityOrder = 1,
SourceIdentifier = new Microsoft.Graph.Beta.Models.IndustryData.IdentifierTypeReferenceValue
{
Code = "username",
},
AdditionalData = new Dictionary<string, object>
{
{
"roleGroup@odata.bind" , "https://graph.microsoft.com/beta/external/industryData/roleGroups('students')"
},
},
},
},
};
var result = await graphClient.External.IndustryData.SourceSystems.PostAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
SourceSystemDefinition sourceSystemDefinition = new SourceSystemDefinition();
sourceSystemDefinition.displayName = "Rostering source";
LinkedList<UserMatchingSetting> userMatchingSettingsList = new LinkedList<UserMatchingSetting>();
UserMatchingSetting userMatchingSettings = new UserMatchingSetting();
UserMatchTargetReferenceValue matchTarget = new UserMatchTargetReferenceValue();
matchTarget.code = "userPrincipalName";
userMatchingSettings.matchTarget = matchTarget;
userMatchingSettings.priorityOrder = 0;
userMatchingSettings.additionalDataManager().put("roleGroup@odata.bind", new JsonPrimitive("https://graph.microsoft.com/beta/external/industryData/roleGroups/staff"));
IdentifierTypeReferenceValue sourceIdentifier = new IdentifierTypeReferenceValue();
sourceIdentifier.code = "username";
userMatchingSettings.sourceIdentifier = sourceIdentifier;
userMatchingSettingsList.add(userMatchingSettings);
UserMatchingSetting userMatchingSettings1 = new UserMatchingSetting();
UserMatchTargetReferenceValue matchTarget1 = new UserMatchTargetReferenceValue();
matchTarget1.code = "userPrincipalName";
userMatchingSettings1.matchTarget = matchTarget1;
userMatchingSettings1.priorityOrder = 1;
userMatchingSettings1.additionalDataManager().put("roleGroup@odata.bind", new JsonPrimitive("https://graph.microsoft.com/beta/external/industryData/roleGroups('students')"));
IdentifierTypeReferenceValue sourceIdentifier1 = new IdentifierTypeReferenceValue();
sourceIdentifier1.code = "username";
userMatchingSettings1.sourceIdentifier = sourceIdentifier1;
userMatchingSettingsList.add(userMatchingSettings1);
sourceSystemDefinition.userMatchingSettings = userMatchingSettingsList;
graphClient.external().industryData().sourceSystems()
.buildRequest()
.post(sourceSystemDefinition);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new SourceSystemDefinition();
$requestBody->setDisplayName('Rostering source');
$userMatchingSettingsUserMatchingSetting1 = new UserMatchingSetting();
$userMatchingSettingsUserMatchingSetting1MatchTarget = new UserMatchTargetReferenceValue();
$userMatchingSettingsUserMatchingSetting1MatchTarget->setCode('userPrincipalName');
$userMatchingSettingsUserMatchingSetting1->setMatchTarget($userMatchingSettingsUserMatchingSetting1MatchTarget);
$userMatchingSettingsUserMatchingSetting1->setPriorityOrder(0);
$userMatchingSettingsUserMatchingSetting1SourceIdentifier = new IdentifierTypeReferenceValue();
$userMatchingSettingsUserMatchingSetting1SourceIdentifier->setCode('username');
$userMatchingSettingsUserMatchingSetting1->setSourceIdentifier($userMatchingSettingsUserMatchingSetting1SourceIdentifier);
$additionalData = [
'roleGroup@odata.bind' => 'https://graph.microsoft.com/beta/external/industryData/roleGroups/staff',
];
$userMatchingSettingsUserMatchingSetting1->setAdditionalData($additionalData);
$userMatchingSettingsArray []= $userMatchingSettingsUserMatchingSetting1;
$userMatchingSettingsUserMatchingSetting2 = new UserMatchingSetting();
$userMatchingSettingsUserMatchingSetting2MatchTarget = new UserMatchTargetReferenceValue();
$userMatchingSettingsUserMatchingSetting2MatchTarget->setCode('userPrincipalName');
$userMatchingSettingsUserMatchingSetting2->setMatchTarget($userMatchingSettingsUserMatchingSetting2MatchTarget);
$userMatchingSettingsUserMatchingSetting2->setPriorityOrder(1);
$userMatchingSettingsUserMatchingSetting2SourceIdentifier = new IdentifierTypeReferenceValue();
$userMatchingSettingsUserMatchingSetting2SourceIdentifier->setCode('username');
$userMatchingSettingsUserMatchingSetting2->setSourceIdentifier($userMatchingSettingsUserMatchingSetting2SourceIdentifier);
$additionalData = [
'roleGroup@odata.bind' => 'https://graph.microsoft.com/beta/external/industryData/roleGroups(\'students\')',
];
$userMatchingSettingsUserMatchingSetting2->setAdditionalData($additionalData);
$userMatchingSettingsArray []= $userMatchingSettingsUserMatchingSetting2;
$requestBody->setUserMatchingSettings($userMatchingSettingsArray);
$result = $graphServiceClient->external()->industryData()->sourceSystems()->post($requestBody)->wait();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.