Namespace: microsoft.graph.industryData
Wichtig
Die APIs unter der /beta Version in Microsoft Graph können sich ändern. Die Verwendung dieser APIs in Produktionsanwendungen wird nicht unterstützt. Um festzustellen, ob eine API in v1.0 verfügbar ist, verwenden Sie die Version Selektor.
Erstellen Sie ein neues oneRosterApiDataConnector-Objekt .
Diese API ist in den folgenden nationalen Cloudbereitstellungen verfügbar.
| Weltweiter Service |
US Government L4 |
US Government L5 (DOD) |
China, betrieben von 21Vianet |
| ✅ |
❌ |
❌ |
❌ |
Berechtigungen
Wählen Sie die Berechtigungen aus, die für diese API als am wenigsten privilegiert markiert sind. Verwenden Sie eine höhere Berechtigung oder Berechtigungen nur, wenn Ihre App dies erfordert. Ausführliche Informationen zu delegierten Berechtigungen und Anwendungsberechtigungen finden Sie unter Berechtigungstypen. Weitere Informationen zu diesen Berechtigungen finden Sie in der Berechtigungsreferenz.
| Berechtigungstyp |
Berechtigungen mit den geringsten Berechtigungen |
Berechtigungen mit höheren Berechtigungen |
| Delegiert (Geschäfts-, Schul- oder Unikonto) |
IndustryData-DataConnector.ReadWrite.All |
Nicht verfügbar. |
| Delegiert (persönliches Microsoft-Konto) |
Nicht unterstützt |
Nicht unterstützt |
| Application |
IndustryData-DataConnector.ReadWrite.All |
Nicht verfügbar. |
HTTP-Anforderung
POST /external/industryData/dataConnectors
Anforderungstext
Geben Sie im Anforderungstext eine JSON-Darstellung des oneRosterApiDataConnector-Objekts an.
In der folgenden Tabelle sind die erforderlichen und optionalen Eigenschaften zum Erstellen eines oneRosterApiDataConnector-Objekts aufgeführt.
| Eigenschaft |
Typ |
Beschreibung |
| displayName |
Zeichenfolge |
Der Name des Datenkonnektors. Geerbt von industryDataConnector. Erforderlich. |
| apiFormat |
microsoft.graph.industryData.apiFormat |
Das API-Format des externen Systems, mit dem eine Verbindung hergestellt wird. Geerbt von apiDataConnector. Die möglichen Werte sind: oneRoster, unknownFutureValue. Erforderlich. |
| baseUrl |
Zeichenfolge |
Der Basis-URI, einschließlich Schema, Host und Pfad, mit oder ohne nachfolgendes "/". Beispiel: "https://example.com/ims/oneRoster/v1p1". Geerbt von apiDataConnector. Erforderlich. |
| Berechtigungsnachweis |
microsoft.graph.industryData.credential |
Der Basistyp für alle unterstützten Anmeldeinformationen. Geerbt von apiDataConnector. Erforderlich. |
| apiVersion |
Zeichenfolge |
Die API-Version der OneRoster-Quelle. Erforderlich. |
| isDemographicsEnabled |
Boolean |
Gibt an, ob der Benutzer angegeben hat, um optionale demografische Daten zu importieren. Erforderlich. |
| isFlagsEnabled |
Boolean |
Gibt an, ob der Benutzer angegeben hat, um optionale Flagdaten zu importieren. Erforderlich. |
| isContactsEnabled |
Boolean |
Gibt an, ob der Benutzer angegeben hat, um optionale Kontaktdaten zu importieren. Erforderlich. |
Antwort
Bei erfolgreicher Ausführung gibt die Methode einen 201 Created Antwortcode und ein aktualisiertes Microsoft.graph.industryData.oneRosterApiDataConnector-Objekt im Antworttext zurück.
Beispiele
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
POST https://graph.microsoft.com/beta/external/industryData/dataConnectors
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.industryData.oneRosterApiDataConnector",
"displayName": "Generic OAuth2 Connector",
"sourceSystem@odata.bind": "https://graph.microsoft.com/beta/external/industryData/sourceSystems('c93a6e02-aeb7-437f-cc52-08dc3fc158af')",
"apiFormat": "oneRoster",
"baseUrl": "https://fakeProvider.net/ims/oneroster/v1p1",
"apiVersion": "1.1",
"credential": {
"@odata.type": "#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
}
// 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);
// 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)
// 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);
const options = {
authProvider,
};
const client = Client.init(options);
const industryDataConnector = {
'@odata.type': '#microsoft.graph.industryData.oneRosterApiDataConnector',
displayName: 'Generic OAuth2 Connector',
'sourceSystem@odata.bind': 'https://graph.microsoft.com/beta/external/industryData/sourceSystems(\'c93a6e02-aeb7-437f-cc52-08dc3fc158af\')',
apiFormat: 'oneRoster',
baseUrl: 'https://fakeProvider.net/ims/oneroster/v1p1',
apiVersion: '1.1',
credential: {
'@odata.type': '#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
};
await client.api('/external/industryData/dataConnectors')
.version('beta')
.post(industryDataConnector);
<?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();
Import-Module Microsoft.Graph.Beta.Search
$params = @{
"@odata.type" = "#microsoft.graph.industryData.oneRosterApiDataConnector"
displayName = "Generic OAuth2 Connector"
"sourceSystem@odata.bind" = "https://graph.microsoft.com/beta/external/industryData/sourceSystems('c93a6e02-aeb7-437f-cc52-08dc3fc158af')"
apiFormat = "oneRoster"
baseUrl = "https://fakeProvider.net/ims/oneroster/v1p1"
apiVersion = "1.1"
credential = @{
"@odata.type" = "#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
}
New-MgBetaExternalIndustryDataConnector -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.industry_data.one_roster_api_data_connector import OneRosterApiDataConnector
from msgraph_beta.generated.models.api_format import ApiFormat
from msgraph_beta.generated.models.industry_data.o_auth2_client_credential import OAuth2ClientCredential
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = OneRosterApiDataConnector(
odata_type = "#microsoft.graph.industryData.oneRosterApiDataConnector",
display_name = "Generic OAuth2 Connector",
api_format = ApiFormat.OneRoster,
base_url = "https://fakeProvider.net/ims/oneroster/v1p1",
api_version = "1.1",
credential = OAuth2ClientCredential(
odata_type = "#microsoft.graph.industryData.oAuth2ClientCredential",
display_name = "One Roster API Credentials",
client_id = "530be723-6af3-4952-8658-668fb2598ad7",
client_secret = "thisIsASecret",
token_url = "https://login.microsoftonline.com/c27f982b-f7ee-4b8b-bb0e-3c55bd1dc02c/oauth2/token",
scope = None,
),
is_demographics_enabled = False,
is_flags_enabled = False,
is_contacts_enabled = False,
additional_data = {
"source_system@odata_bind" : "https://graph.microsoft.com/beta/external/industryData/sourceSystems('c93a6e02-aeb7-437f-cc52-08dc3fc158af')",
}
)
result = await graph_client.external.industry_data.data_connectors.post(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.industryData.oneRosterApiDataConnector",
"id": "f72b2c92-4b8b-461d-3725-08dc3fc158ff",
"displayName": "Generic OAuth2 Connector",
"apiFormat": "oneRoster",
"baseUrl": "https://fakeProvider.net/ims/oneroster/v1p1",
"apiVersion": "1.1",
"isDemographicsEnabled": false,
"isFlagsEnabled": false,
"isContactsEnabled": false,
"credential": {
"@odata.type": "#microsoft.graph.industryData.oAuth2ClientCredential",
"displayName": "One Roster API Credentials",
"isValid": true,
"lastValidDateTime": null,
"clientId": "530be723-6af3-4952-8658-668fb2598ad7",
"tokenUrl": "https://login.microsoftonline.com/c27f982b-f7ee-4b8b-bb0e-3c55bd1dc02c/oauth2/token",
"scope": null
}
}