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.
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
The API format of the external system being connected to. Inherited from apiDataConnector. The possible values are: oneRoster, unknownFutureValue. Required.
baseUrl
String
The base URI, including the scheme, host, and path, with or without a trailing '/'. For example, "https://example.com/ims/oneRoster/v1p1". Inherited from apiDataConnector. Required.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models.IndustryData;
var requestBody = new OneRosterApiDataConnector
{
OdataType = "#microsoft.graph.industryData.oneRosterApiDataConnector",
DisplayName = "Generic OAuth2 Connector",
ApiFormat = ApiFormat.OneRoster,
BaseUrl = "https://fakeProvider.net/ims/oneroster/v1p1",
ApiVersion = "1.1",
Credential = new OAuth2ClientCredential
{
OdataType = "#microsoft.graph.industryData.oAuth2ClientCredential",
DisplayName = "One Roster API Credentials",
ClientId = "530be723-6af3-4952-8658-668fb2598ad7",
ClientSecret = "thisIsASecret",
TokenUrl = "https://login.microsoftonline.com/c27f982b-f7ee-4b8b-bb0e-3c55bd1dc02c/oauth2/token",
Scope = null,
},
IsDemographicsEnabled = false,
IsFlagsEnabled = false,
IsContactsEnabled = false,
AdditionalData = new Dictionary<string, object>
{
{
"sourceSystem@odata.bind" , "https://graph.microsoft.com/beta/external/industryData/sourceSystems('c93a6e02-aeb7-437f-cc52-08dc3fc158af')"
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.External.IndustryData.DataConnectors.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.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodelsindustrydata "github.com/microsoftgraph/msgraph-beta-sdk-go/models/industrydata"
//other-imports
)
requestBody := graphmodelsindustrydata.NewIndustryDataConnector()
displayName := "Generic OAuth2 Connector"
requestBody.SetDisplayName(&displayName)
apiFormat := graphmodels.ONEROSTER_APIFORMAT
requestBody.SetApiFormat(&apiFormat)
baseUrl := "https://fakeProvider.net/ims/oneroster/v1p1"
requestBody.SetBaseUrl(&baseUrl)
apiVersion := "1.1"
requestBody.SetApiVersion(&apiVersion)
credential := graphmodelsindustrydata.NewOAuth2ClientCredential()
displayName := "One Roster API Credentials"
credential.SetDisplayName(&displayName)
clientId := "530be723-6af3-4952-8658-668fb2598ad7"
credential.SetClientId(&clientId)
clientSecret := "thisIsASecret"
credential.SetClientSecret(&clientSecret)
tokenUrl := "https://login.microsoftonline.com/c27f982b-f7ee-4b8b-bb0e-3c55bd1dc02c/oauth2/token"
credential.SetTokenUrl(&tokenUrl)
scope := null
credential.SetScope(&scope)
requestBody.SetCredential(credential)
isDemographicsEnabled := false
requestBody.SetIsDemographicsEnabled(&isDemographicsEnabled)
isFlagsEnabled := false
requestBody.SetIsFlagsEnabled(&isFlagsEnabled)
isContactsEnabled := false
requestBody.SetIsContactsEnabled(&isContactsEnabled)
additionalData := map[string]interface{}{
"sourceSystem@odata.bind" : "https://graph.microsoft.com/beta/external/industryData/sourceSystems('c93a6e02-aeb7-437f-cc52-08dc3fc158af')",
}
requestBody.SetAdditionalData(additionalData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
dataConnectors, err := graphClient.External().IndustryData().DataConnectors().Post(context.Background(), requestBody, nil)
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.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.models.industrydata.OneRosterApiDataConnector industryDataConnector = new com.microsoft.graph.beta.models.industrydata.OneRosterApiDataConnector();
industryDataConnector.setOdataType("#microsoft.graph.industryData.oneRosterApiDataConnector");
industryDataConnector.setDisplayName("Generic OAuth2 Connector");
industryDataConnector.setApiFormat(com.microsoft.graph.beta.models.industrydata.ApiFormat.OneRoster);
industryDataConnector.setBaseUrl("https://fakeProvider.net/ims/oneroster/v1p1");
industryDataConnector.setApiVersion("1.1");
com.microsoft.graph.beta.models.industrydata.OAuth2ClientCredential credential = new com.microsoft.graph.beta.models.industrydata.OAuth2ClientCredential();
credential.setOdataType("#microsoft.graph.industryData.oAuth2ClientCredential");
credential.setDisplayName("One Roster API Credentials");
credential.setClientId("530be723-6af3-4952-8658-668fb2598ad7");
credential.setClientSecret("thisIsASecret");
credential.setTokenUrl("https://login.microsoftonline.com/c27f982b-f7ee-4b8b-bb0e-3c55bd1dc02c/oauth2/token");
credential.setScope(null);
industryDataConnector.setCredential(credential);
industryDataConnector.setIsDemographicsEnabled(false);
industryDataConnector.setIsFlagsEnabled(false);
industryDataConnector.setIsContactsEnabled(false);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("sourceSystem@odata.bind", "https://graph.microsoft.com/beta/external/industryData/sourceSystems('c93a6e02-aeb7-437f-cc52-08dc3fc158af')");
industryDataConnector.setAdditionalData(additionalData);
com.microsoft.graph.models.industrydata.IndustryDataConnector result = graphClient.external().industryData().dataConnectors().post(industryDataConnector);
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
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\IndustryData\OneRosterApiDataConnector;
use Microsoft\Graph\Beta\Generated\Models\IndustryData\ApiFormat;
use Microsoft\Graph\Beta\Generated\Models\IndustryData\OAuth2ClientCredential;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new OneRosterApiDataConnector();
$requestBody->setOdataType('#microsoft.graph.industryData.oneRosterApiDataConnector');
$requestBody->setDisplayName('Generic OAuth2 Connector');
$requestBody->setApiFormat(new ApiFormat('oneRoster'));
$requestBody->setBaseUrl('https://fakeProvider.net/ims/oneroster/v1p1');
$requestBody->setApiVersion('1.1');
$credential = new OAuth2ClientCredential();
$credential->setOdataType('#microsoft.graph.industryData.oAuth2ClientCredential');
$credential->setDisplayName('One Roster API Credentials');
$credential->setClientId('530be723-6af3-4952-8658-668fb2598ad7');
$credential->setClientSecret('thisIsASecret');
$credential->setTokenUrl('https://login.microsoftonline.com/c27f982b-f7ee-4b8b-bb0e-3c55bd1dc02c/oauth2/token');
$credential->setScope(null);
$requestBody->setCredential($credential);
$requestBody->setIsDemographicsEnabled(false);
$requestBody->setIsFlagsEnabled(false);
$requestBody->setIsContactsEnabled(false);
$additionalData = [
'sourceSystem@odata.bind' => 'https://graph.microsoft.com/beta/external/industryData/sourceSystems(\'c93a6e02-aeb7-437f-cc52-08dc3fc158af\')',
];
$requestBody->setAdditionalData($additionalData);
$result = $graphServiceClient->external()->industryData()->dataConnectors()->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.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see: https://aka.ms/ContentUserFeedback.