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.
Create the schema for a Microsoft Search connection.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Use this to cause the request to execute asynchronously. Optional.
Request body
In the request body, supply a JSON representation of a schema object.
When you register a custom item schema, the schema object must have the baseType property set to microsoft.graph.externalItem and must contain the properties property. The properties object must contain at least one property, up to a maximum of 128.
Response
If successful, this method returns a 202 Accepted response code and a URL in the Location response header that can be used to get the operation status.
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var schema = new Microsoft.Graph.ExternalConnectors.Schema
{
BaseType = "microsoft.graph.externalItem",
Properties = new List<Microsoft.Graph.ExternalConnectors.Property>()
{
new Microsoft.Graph.ExternalConnectors.Property
{
Name = "ticketTitle",
Type = Microsoft.Graph.ExternalConnectors.PropertyType.String,
IsSearchable = true,
IsRetrievable = true,
Labels = new List<Microsoft.Graph.ExternalConnectors.Label>()
{
Microsoft.Graph.ExternalConnectors.Label.Title
}
},
new Microsoft.Graph.ExternalConnectors.Property
{
Name = "priority",
Type = Microsoft.Graph.ExternalConnectors.PropertyType.String,
IsQueryable = true,
IsRetrievable = true,
IsSearchable = false
},
new Microsoft.Graph.ExternalConnectors.Property
{
Name = "assignee",
Type = Microsoft.Graph.ExternalConnectors.PropertyType.String,
IsRetrievable = true
}
}
};
await graphClient.External.Connections["{externalConnectors.externalConnection-id}"].Schema
.Request()
.AddAsync(schema);
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.
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := graphmodels.NewSchemaPostRequestBody()
additionalData := map[string]interface{}{
"baseType" : "microsoft.graph.externalItem",
:= graphmodels.New()
name := "ticketTitle"
.SetName(&name)
type := "string"
.SetType(&type)
isSearchable := "true"
.SetIsSearchable(&isSearchable)
isRetrievable := "true"
.SetIsRetrievable(&isRetrievable)
labels := []string {
"title",
}
.SetLabels(labels)
:= graphmodels.New()
name := "priority"
.SetName(&name)
type := "string"
.SetType(&type)
isQueryable := "true"
.SetIsQueryable(&isQueryable)
isRetrievable := "true"
.SetIsRetrievable(&isRetrievable)
isSearchable := "false"
.SetIsSearchable(&isSearchable)
:= graphmodels.New()
name := "assignee"
.SetName(&name)
type := "string"
.SetType(&type)
isRetrievable := "true"
.SetIsRetrievable(&isRetrievable)
properties := []graphmodels.Objectable {
,
,
,
}
}
requestBody.SetAdditionalData(additionalData)
graphClient.External().ConnectionsById("externalConnection-id").Schema().Post(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.
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new SchemaPostRequestBody();
$additionalData = [
'baseType' => 'microsoft.graph.externalItem',
'properties' => $properties1 = new ();
$ properties1->setName('ticketTitle');
$ properties1->setType('string');
$ properties1->setIsSearchable('true');
$ properties1->setIsRetrievable('true');
$properties1->setLabels(['title', ]);
$propertiesArray []= $properties1;
$properties2 = new ();
$ properties2->setName('priority');
$ properties2->setType('string');
$ properties2->setIsQueryable('true');
$ properties2->setIsRetrievable('true');
$ properties2->setIsSearchable('false');
$propertiesArray []= $properties2;
$properties3 = new ();
$ properties3->setName('assignee');
$ properties3->setType('string');
$ properties3->setIsRetrievable('true');
$propertiesArray []= $properties3;
$requestBody->setProperties($propertiesArray);
];
$requestBody->setAdditionalData($additionalData);
$graphServiceClient->external()->connectionsById('externalConnection-id')->schema()->post($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.