Namespace: microsoft.graph.externalConnectors
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 externalItem.
Diese API kann zum Erstellen eines benutzerdefinierten Gegenstands verwendet werden. Für die enthaltende externalConnection muss ein Schema des entsprechenden Typs registriert sein.
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) |
ExternalItem.ReadWrite.OwnedBy |
ExternalItem.ReadWrite.All |
| Delegiert (persönliches Microsoft-Konto) |
Nicht unterstützt |
Nicht unterstützt |
| Application |
ExternalItem.ReadWrite.OwnedBy |
ExternalItem.ReadWrite.All |
HTTP-Anforderung
PUT /external/connections/{connection-id}/items/{item-id}
Pfadparameter
| Parameter |
Typ |
Beschreibung |
| Verbindungs-ID |
string |
Die id Eigenschaft der enthaltenden externalConnection |
| item-id |
string |
Die vom Entwickler bereitgestellte id Eigenschaft des externalItem. Wenn noch kein Element mit diesem idvorhanden ist, wird ein neues Element erstellt. Wenn dieses Element bereits vorhanden ist id, wird es von dem im Text gesendeten Objekt überschrieben. |
Anforderungstext
Geben Sie im Anforderungstext eine JSON-Darstellung eines externalItem-Objekts an. Die Nutzlast ist auf 30 MB begrenzt.
Wenn Sie ein externalItem erstellen, sind die folgenden Eigenschaften erforderlich: ACL und Eigenschaften. Das Eigenschaftenobjekt muss mindestens eine Eigenschaft enthalten. Sie können auch die informationProtectionLabel-Eigenschaft verwenden, um eine Microsoft Purview-Vertraulichkeitsbezeichnung für ein externalItem festzulegen.
Alle DateTime Typeigenschaften müssen im ISO 8601-Format vorliegen.
Eigenschaften auf einer externalItem sollten in den folgenden Szenarien Typbezeichner in der Nutzlast verwenden:
Für String Typeigenschaften, wenn der Wert Nicht-ASCII-Zeichen enthält.
"description@odata.type": "String",
"description": "Kandierte Äpfel"
Für alle Sammlungstypen.
"categories@odata.type": "Collection(String)"
"categories": [
"red",
"blue"
]
Wichtig
Wenn Sie eine Eigenschaft vom Typ Collection(DateTime)einschließen, müssen Sie den Typbezeichner Collection(DateTimeOffset)verwenden.
Antwort
Wenn die Methode erfolgreich verläuft, wird der Antwortcode 200 OK zurückgegeben.
Beispiele
Beispiel: Erstellen eines benutzerdefinierten Elements
Anforderung
Das folgende Beispiel zeigt eine Anfrage.
PUT https://graph.microsoft.com/beta/external/connections/contosohr/items/TSP228082938
Content-type: application/json
{
"acl": [
{
"type": "user",
"value": "e811976d-83df-4cbd-8b9b-5215b18aa874",
"accessType": "grant",
"identitySource": "azureActiveDirectory"
},
{
"type": "group",
"value": "14m1b9c38qe647f6a",
"accessType": "deny",
"identitySource": "external"
}
],
"properties": {
"title": "Fix issues with Payment gateway",
"priority": 1,
"assignee": "john@contoso.com"
},
"content": {
"value": "Payment gateway module has the following tasks to be completed...",
"type": "text"
},
"informationProtectionLabel": {
"sensitivityLabelId": "b6a62c3c-d471-4a3e-9f5f-93c1f928b02d"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models.ExternalConnectors;
var requestBody = new ExternalItem
{
Acl = new List<Acl>
{
new Acl
{
Type = AclType.User,
Value = "e811976d-83df-4cbd-8b9b-5215b18aa874",
AccessType = AccessType.Grant,
IdentitySource = IdentitySourceType.AzureActiveDirectory,
},
new Acl
{
Type = AclType.Group,
Value = "14m1b9c38qe647f6a",
AccessType = AccessType.Deny,
IdentitySource = IdentitySourceType.External,
},
},
Properties = new Properties
{
AdditionalData = new Dictionary<string, object>
{
{
"title" , "Fix issues with Payment gateway"
},
{
"priority" , 1
},
{
"assignee" , "john@contoso.com"
},
},
},
Content = new ExternalItemContent
{
Value = "Payment gateway module has the following tasks to be completed...",
Type = ExternalItemContentType.Text,
},
InformationProtectionLabel = new ExternalItemInformationProtectionLabel
{
SensitivityLabelId = "b6a62c3c-d471-4a3e-9f5f-93c1f928b02d",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.External.Connections["{externalConnection-id}"].Items["{externalItem-id}"].PutAsync(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"
graphmodelsexternalconnectors "github.com/microsoftgraph/msgraph-beta-sdk-go/models/externalconnectors"
//other-imports
)
requestBody := graphmodelsexternalconnectors.NewExternalItem()
acl := graphmodelsexternalconnectors.NewAcl()
type := graphmodels.USER_ACLTYPE
acl.SetType(&type)
value := "e811976d-83df-4cbd-8b9b-5215b18aa874"
acl.SetValue(&value)
accessType := graphmodels.GRANT_ACCESSTYPE
acl.SetAccessType(&accessType)
identitySource := graphmodels.AZUREACTIVEDIRECTORY_IDENTITYSOURCETYPE
acl.SetIdentitySource(&identitySource)
acl1 := graphmodelsexternalconnectors.NewAcl()
type := graphmodels.GROUP_ACLTYPE
acl1.SetType(&type)
value := "14m1b9c38qe647f6a"
acl1.SetValue(&value)
accessType := graphmodels.DENY_ACCESSTYPE
acl1.SetAccessType(&accessType)
identitySource := graphmodels.EXTERNAL_IDENTITYSOURCETYPE
acl1.SetIdentitySource(&identitySource)
acl := []graphmodelsexternalconnectors.Aclable {
acl,
acl1,
}
requestBody.SetAcl(acl)
properties := graphmodelsexternalconnectors.NewProperties()
additionalData := map[string]interface{}{
"title" : "Fix issues with Payment gateway",
"priority" : int32(1) ,
"assignee" : "john@contoso.com",
}
properties.SetAdditionalData(additionalData)
requestBody.SetProperties(properties)
content := graphmodelsexternalconnectors.NewExternalItemContent()
value := "Payment gateway module has the following tasks to be completed..."
content.SetValue(&value)
type := graphmodels.TEXT_EXTERNALITEMCONTENTTYPE
content.SetType(&type)
requestBody.SetContent(content)
informationProtectionLabel := graphmodelsexternalconnectors.NewExternalItemInformationProtectionLabel()
sensitivityLabelId := "b6a62c3c-d471-4a3e-9f5f-93c1f928b02d"
informationProtectionLabel.SetSensitivityLabelId(&sensitivityLabelId)
requestBody.SetInformationProtectionLabel(informationProtectionLabel)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
items, err := graphClient.External().Connections().ByExternalConnectionId("externalConnection-id").Items().ByExternalItemId("externalItem-id").Put(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.externalconnectors.ExternalItem externalItem = new com.microsoft.graph.beta.models.externalconnectors.ExternalItem();
LinkedList<com.microsoft.graph.beta.models.externalconnectors.Acl> acl = new LinkedList<com.microsoft.graph.beta.models.externalconnectors.Acl>();
com.microsoft.graph.beta.models.externalconnectors.Acl acl1 = new com.microsoft.graph.beta.models.externalconnectors.Acl();
acl1.setType(com.microsoft.graph.beta.models.externalconnectors.AclType.User);
acl1.setValue("e811976d-83df-4cbd-8b9b-5215b18aa874");
acl1.setAccessType(com.microsoft.graph.beta.models.externalconnectors.AccessType.Grant);
acl1.setIdentitySource(com.microsoft.graph.beta.models.externalconnectors.IdentitySourceType.AzureActiveDirectory);
acl.add(acl1);
com.microsoft.graph.beta.models.externalconnectors.Acl acl2 = new com.microsoft.graph.beta.models.externalconnectors.Acl();
acl2.setType(com.microsoft.graph.beta.models.externalconnectors.AclType.Group);
acl2.setValue("14m1b9c38qe647f6a");
acl2.setAccessType(com.microsoft.graph.beta.models.externalconnectors.AccessType.Deny);
acl2.setIdentitySource(com.microsoft.graph.beta.models.externalconnectors.IdentitySourceType.External);
acl.add(acl2);
externalItem.setAcl(acl);
com.microsoft.graph.beta.models.externalconnectors.Properties properties = new com.microsoft.graph.beta.models.externalconnectors.Properties();
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("title", "Fix issues with Payment gateway");
additionalData.put("priority", 1);
additionalData.put("assignee", "john@contoso.com");
properties.setAdditionalData(additionalData);
externalItem.setProperties(properties);
com.microsoft.graph.beta.models.externalconnectors.ExternalItemContent content = new com.microsoft.graph.beta.models.externalconnectors.ExternalItemContent();
content.setValue("Payment gateway module has the following tasks to be completed...");
content.setType(com.microsoft.graph.beta.models.externalconnectors.ExternalItemContentType.Text);
externalItem.setContent(content);
com.microsoft.graph.beta.models.externalconnectors.ExternalItemInformationProtectionLabel informationProtectionLabel = new com.microsoft.graph.beta.models.externalconnectors.ExternalItemInformationProtectionLabel();
informationProtectionLabel.setSensitivityLabelId("b6a62c3c-d471-4a3e-9f5f-93c1f928b02d");
externalItem.setInformationProtectionLabel(informationProtectionLabel);
com.microsoft.graph.models.externalconnectors.ExternalItem result = graphClient.external().connections().byExternalConnectionId("{externalConnection-id}").items().byExternalItemId("{externalItem-id}").put(externalItem);
const options = {
authProvider,
};
const client = Client.init(options);
const externalItem = {
acl: [
{
type: 'user',
value: 'e811976d-83df-4cbd-8b9b-5215b18aa874',
accessType: 'grant',
identitySource: 'azureActiveDirectory'
},
{
type: 'group',
value: '14m1b9c38qe647f6a',
accessType: 'deny',
identitySource: 'external'
}
],
properties: {
title: 'Fix issues with Payment gateway',
priority: 1,
assignee: 'john@contoso.com'
},
content: {
value: 'Payment gateway module has the following tasks to be completed...',
type: 'text'
},
informationProtectionLabel: {
sensitivityLabelId: 'b6a62c3c-d471-4a3e-9f5f-93c1f928b02d'
}
};
await client.api('/external/connections/contosohr/items/TSP228082938')
.version('beta')
.put(externalItem);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\ExternalConnectors\ExternalItem;
use Microsoft\Graph\Beta\Generated\Models\ExternalConnectors\Acl;
use Microsoft\Graph\Beta\Generated\Models\ExternalConnectors\AclType;
use Microsoft\Graph\Beta\Generated\Models\ExternalConnectors\AccessType;
use Microsoft\Graph\Beta\Generated\Models\ExternalConnectors\IdentitySourceType;
use Microsoft\Graph\Beta\Generated\Models\ExternalConnectors\Properties;
use Microsoft\Graph\Beta\Generated\Models\ExternalConnectors\ExternalItemContent;
use Microsoft\Graph\Beta\Generated\Models\ExternalConnectors\ExternalItemContentType;
use Microsoft\Graph\Beta\Generated\Models\ExternalConnectors\ExternalItemInformationProtectionLabel;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ExternalItem();
$aclAcl1 = new Acl();
$aclAcl1->setType(new AclType('user'));
$aclAcl1->setValue('e811976d-83df-4cbd-8b9b-5215b18aa874');
$aclAcl1->setAccessType(new AccessType('grant'));
$aclAcl1->setIdentitySource(new IdentitySourceType('azureActiveDirectory'));
$aclArray []= $aclAcl1;
$aclAcl2 = new Acl();
$aclAcl2->setType(new AclType('group'));
$aclAcl2->setValue('14m1b9c38qe647f6a');
$aclAcl2->setAccessType(new AccessType('deny'));
$aclAcl2->setIdentitySource(new IdentitySourceType('external'));
$aclArray []= $aclAcl2;
$requestBody->setAcl($aclArray);
$properties = new Properties();
$additionalData = [
'title' => 'Fix issues with Payment gateway',
'priority' => 1,
'assignee' => 'john@contoso.com',
];
$properties->setAdditionalData($additionalData);
$requestBody->setProperties($properties);
$content = new ExternalItemContent();
$content->setValue('Payment gateway module has the following tasks to be completed...');
$content->setType(new ExternalItemContentType('text'));
$requestBody->setContent($content);
$informationProtectionLabel = new ExternalItemInformationProtectionLabel();
$informationProtectionLabel->setSensitivityLabelId('b6a62c3c-d471-4a3e-9f5f-93c1f928b02d');
$requestBody->setInformationProtectionLabel($informationProtectionLabel);
$result = $graphServiceClient->external()->connections()->byExternalConnectionId('externalConnection-id')->items()->byExternalItemId('externalItem-id')->put($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Search
$params = @{
acl = @(
@{
type = "user"
value = "e811976d-83df-4cbd-8b9b-5215b18aa874"
accessType = "grant"
identitySource = "azureActiveDirectory"
}
@{
type = "group"
value = "14m1b9c38qe647f6a"
accessType = "deny"
identitySource = "external"
}
)
properties = @{
title = "Fix issues with Payment gateway"
priority =
assignee = "john@contoso.com"
}
content = @{
value = "Payment gateway module has the following tasks to be completed..."
type = "text"
}
informationProtectionLabel = @{
sensitivityLabelId = "b6a62c3c-d471-4a3e-9f5f-93c1f928b02d"
}
}
Set-MgBetaExternalConnectionItem -ExternalConnectionId $externalConnectionId -ExternalItemId $externalItemId -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.external_connectors.external_item import ExternalItem
from msgraph_beta.generated.models.external_connectors.acl import Acl
from msgraph_beta.generated.models.acl_type import AclType
from msgraph_beta.generated.models.access_type import AccessType
from msgraph_beta.generated.models.identity_source_type import IdentitySourceType
from msgraph_beta.generated.models.external_connectors.properties import Properties
from msgraph_beta.generated.models.external_connectors.external_item_content import ExternalItemContent
from msgraph_beta.generated.models.external_item_content_type import ExternalItemContentType
from msgraph_beta.generated.models.external_connectors.external_item_information_protection_label import ExternalItemInformationProtectionLabel
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ExternalItem(
acl = [
Acl(
type = AclType.User,
value = "e811976d-83df-4cbd-8b9b-5215b18aa874",
access_type = AccessType.Grant,
identity_source = IdentitySourceType.AzureActiveDirectory,
),
Acl(
type = AclType.Group,
value = "14m1b9c38qe647f6a",
access_type = AccessType.Deny,
identity_source = IdentitySourceType.External,
),
],
properties = Properties(
additional_data = {
"title" : "Fix issues with Payment gateway",
"priority" : 1,
"assignee" : "john@contoso.com",
}
),
content = ExternalItemContent(
value = "Payment gateway module has the following tasks to be completed...",
type = ExternalItemContentType.Text,
),
information_protection_label = ExternalItemInformationProtectionLabel(
sensitivity_label_id = "b6a62c3c-d471-4a3e-9f5f-93c1f928b02d",
),
)
result = await graph_client.external.connections.by_external_connection_id('externalConnection-id').items.by_external_item_id('externalItem-id').put(request_body)
Antwort
Das folgende Beispiel zeigt die Antwort.
HTTP/1.1 200 OK