POST https://graph.microsoft.com/v1.0/external/connections
Content-Type: application/json
{
"id": "contosohr",
"name": "Contoso HR",
"description": "Connection to index Contoso HR system"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models.ExternalConnectors;
var requestBody = new ExternalConnection
{
Id = "contosohr",
Name = "Contoso HR",
Description = "Connection to index Contoso HR system",
};
// To initialize your graphClient, see https://zcusa.951200.xyz/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.External.Connections.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodelsexternalconnectors "github.com/microsoftgraph/msgraph-sdk-go/models/externalconnectors"
//other-imports
)
requestBody := graphmodelsexternalconnectors.NewExternalConnection()
id := "contosohr"
requestBody.SetId(&id)
name := "Contoso HR"
requestBody.SetName(&name)
description := "Connection to index Contoso HR system"
requestBody.SetDescription(&description)
// To initialize your graphClient, see https://zcusa.951200.xyz/en-us/graph/sdks/create-client?from=snippets&tabs=go
connections, err := graphClient.External().Connections().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.models.externalconnectors.ExternalConnection externalConnection = new com.microsoft.graph.models.externalconnectors.ExternalConnection();
externalConnection.setId("contosohr");
externalConnection.setName("Contoso HR");
externalConnection.setDescription("Connection to index Contoso HR system");
com.microsoft.graph.models.externalconnectors.ExternalConnection result = graphClient.external().connections().post(externalConnection);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\ExternalConnectors\ExternalConnection;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ExternalConnection();
$requestBody->setId('contosohr');
$requestBody->setName('Contoso HR');
$requestBody->setDescription('Connection to index Contoso HR system');
$result = $graphServiceClient->external()->connections()->post($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.external_connectors.external_connection import ExternalConnection
# To initialize your graph_client, see https://zcusa.951200.xyz/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ExternalConnection(
id = "contosohr",
name = "Contoso HR",
description = "Connection to index Contoso HR system",
)
result = await graph_client.external.connections.post(request_body)