participant: invite
Article
06/08/2023
15 contributors
Feedback
In this article
Namespace: microsoft.graph
Invite participants to the active call.
For more information about how to handle operations, see commsOperation .
Note: Inviting multiple participants in one request is only supported for group calls.
This API is available in the following national cloud deployments .
Global service
US Government L4
US Government L5 (DOD)
China operated by 21Vianet
✅
✅
✅
❌
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions .
Permission type
Permissions (from least to most privileged)
Delegated (work or school account)
Not supported
Delegated (personal Microsoft account)
Not supported
Application
Calls.InitiateGroupCalls.All
HTTP request
POST /communications/calls/{id}/participants/invite
Name
Description
Authorization
Bearer {token}. Required.
Content-type
application/json. Required.
Request body
In the request body, provide a JSON object with the following parameters.
Parameter
Type
Description
participants
invitationParticipantInfo collection
The participants to be invited.
clientContext
String
Unique Client Context string. Max limit is 256 chars.
Response
If successful, this method returns a 200 OK response code and a location header with a URI to the inviteParticipantsOperation created for this request.
The body of the response contains the created inviteParticipantsOperation .
Note: When this API returns a successful response, all participants will receive a roster update.
Examples
The following examples show how to call this API.
Note: The response objects might be shortened for readability. All the properties will be returned from an actual call.
Example 1: Invite one participant to an existing call
Request
POST https://graph.microsoft.com/v1.0/communications/calls/{id}/participants/invite
Content-Type: application/json
{
"participants": [
{
"@odata.type": "#microsoft.graph.invitationParticipantInfo",
"replacesCallId": "a7ebfb2d-871e-419c-87af-27290b22e8db",
"identity": {
"@odata.type": "#microsoft.graph.identitySet",
"user": {
"@odata.type": "#microsoft.graph.identity",
"id": "278405a3-f568-4b3e-b684-009193463064",
"displayName": "string"
}
}
}
],
"clientContext": "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Communications.Calls.Item.Participants.Invite.InvitePostRequestBody
{
Participants = new List<InvitationParticipantInfo>
{
new InvitationParticipantInfo
{
OdataType = "#microsoft.graph.invitationParticipantInfo",
ReplacesCallId = "a7ebfb2d-871e-419c-87af-27290b22e8db",
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
User = new Identity
{
OdataType = "#microsoft.graph.identity",
Id = "278405a3-f568-4b3e-b684-009193463064",
DisplayName = "string",
},
},
},
},
ClientContext = "f2fa86af-3c51-4bc2-8fc0-475452d9764f",
};
var result = await graphClient.Communications.Calls["{call-id}"].Participants.Invite.PostAsync(requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc communications calls participants invite post --call-id {call-id} --body '{\
"participants": [\
{\
"@odata.type": "#microsoft.graph.invitationParticipantInfo",\
"replacesCallId": "a7ebfb2d-871e-419c-87af-27290b22e8db",\
"identity": {\
"@odata.type": "#microsoft.graph.identitySet",\
"user": {\
"@odata.type": "#microsoft.graph.identity",\
"id": "278405a3-f568-4b3e-b684-009193463064",\
"displayName": "string"\
}\
}\
}\
],\
"clientContext": "f2fa86af-3c51-4bc2-8fc0-475452d9764f"\
}\
'
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphcommunications "github.com/microsoftgraph/msgraph-sdk-go/communications"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphcommunications.NewInvitePostRequestBody()
invitationParticipantInfo := graphmodels.NewInvitationParticipantInfo()
replacesCallId := "a7ebfb2d-871e-419c-87af-27290b22e8db"
invitationParticipantInfo.SetReplacesCallId(&replacesCallId)
identity := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
id := "278405a3-f568-4b3e-b684-009193463064"
user.SetId(&id)
displayName := "string"
user.SetDisplayName(&displayName)
identity.SetUser(user)
invitationParticipantInfo.SetIdentity(identity)
participants := []graphmodels.InvitationParticipantInfoable {
invitationParticipantInfo,
}
requestBody.SetParticipants(participants)
clientContext := "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
requestBody.SetClientContext(&clientContext)
invite, err := graphClient.Communications().Calls().ByCallId("call-id").Participants().Invite().Post(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
LinkedList<InvitationParticipantInfo> participantsList = new LinkedList<InvitationParticipantInfo>();
InvitationParticipantInfo participants = new InvitationParticipantInfo();
participants.replacesCallId = "a7ebfb2d-871e-419c-87af-27290b22e8db";
IdentitySet identity = new IdentitySet();
Identity user = new Identity();
user.id = "278405a3-f568-4b3e-b684-009193463064";
user.displayName = "string";
identity.user = user;
participants.identity = identity;
participantsList.add(participants);
String clientContext = "f2fa86af-3c51-4bc2-8fc0-475452d9764f";
graphClient.communications().calls("{id}").participants()
.invite(ParticipantInviteParameterSet
.newBuilder()
.withParticipants(participantsList)
.withClientContext(clientContext)
.build())
.buildRequest()
.post();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
const options = {
authProvider,
};
const client = Client.init(options);
const inviteParticipantsOperation = {
participants: [
{
'@odata.type': '#microsoft.graph.invitationParticipantInfo',
replacesCallId: 'a7ebfb2d-871e-419c-87af-27290b22e8db',
identity: {
'@odata.type': '#microsoft.graph.identitySet',
user: {
'@odata.type': '#microsoft.graph.identity',
id: '278405a3-f568-4b3e-b684-009193463064',
displayName: 'string'
}
}
}
],
clientContext: 'f2fa86af-3c51-4bc2-8fc0-475452d9764f'
};
await client.api('/communications/calls/{id}/participants/invite')
.post(inviteParticipantsOperation);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new InvitePostRequestBody();
$participantsInvitationParticipantInfo1 = new InvitationParticipantInfo();
$participantsInvitationParticipantInfo1->setOdataType('#microsoft.graph.invitationParticipantInfo');
$participantsInvitationParticipantInfo1->setReplacesCallId('a7ebfb2d-871e-419c-87af-27290b22e8db');
$participantsInvitationParticipantInfo1Identity = new IdentitySet();
$participantsInvitationParticipantInfo1Identity->setOdataType('#microsoft.graph.identitySet');
$participantsInvitationParticipantInfo1IdentityUser = new Identity();
$participantsInvitationParticipantInfo1IdentityUser->setOdataType('#microsoft.graph.identity');
$participantsInvitationParticipantInfo1IdentityUser->setId('278405a3-f568-4b3e-b684-009193463064');
$participantsInvitationParticipantInfo1IdentityUser->setDisplayName('string');
$participantsInvitationParticipantInfo1Identity->setUser($participantsInvitationParticipantInfo1IdentityUser);
$participantsInvitationParticipantInfo1->setIdentity($participantsInvitationParticipantInfo1Identity);
$participantsArray []= $participantsInvitationParticipantInfo1;
$requestBody->setParticipants($participantsArray);
$requestBody->setClientContext('f2fa86af-3c51-4bc2-8fc0-475452d9764f');
$result = $graphServiceClient->communications()->calls()->byCallId('call-id')->participants()->invite()->post($requestBody)->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Import-Module Microsoft.Graph.CloudCommunications
$params = @{
participants = @(
@{
"@odata.type" = "#microsoft.graph.invitationParticipantInfo"
replacesCallId = "a7ebfb2d-871e-419c-87af-27290b22e8db"
identity = @{
"@odata.type" = "#microsoft.graph.identitySet"
user = @{
"@odata.type" = "#microsoft.graph.identity"
id = "278405a3-f568-4b3e-b684-009193463064"
displayName = "string"
}
}
}
)
clientContext = "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
}
Invoke-MgInviteCommunicationCallParticipant -CallId $callId -BodyParameter $params
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = InvitePostRequestBody(
participants = [
InvitationParticipantInfo(
odata_type = "#microsoft.graph.invitationParticipantInfo",
replaces_call_id = "a7ebfb2d-871e-419c-87af-27290b22e8db",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
user = Identity(
odata_type = "#microsoft.graph.identity",
id = "278405a3-f568-4b3e-b684-009193463064",
display_name = "string",
),
),
),
]
client_context = "f2fa86af-3c51-4bc2-8fc0-475452d9764f",
)
result = await graph_client.communications.calls.by_call_id('call-id').participants.invite.post(body = request_body)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Response
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.inviteParticipantsOperation",
"id": "eec3812a-fdc3-4fb4-825c-a06c9f35414e",
"status": "Running",
"clientContext": "f2fa86af-3c51-4bc2-8fc0-475452d9764f",
"resultInfo": null,
"participants": [
{
"endpointType": null,
"replacesCallId": "a7ebfb2d-871e-419c-87af-27290b22e8db",
"identity": {
"user": {
"@odata.type": "#microsoft.graph.identity",
"id": "278405a3-f568-4b3e-b684-009193463064",
"displayName": "string"
},
"application": null,
"device": null,
"phone": null
}
}
]
}
Notification - operation completed
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type":"#microsoft.graph.commsNotifications",
"value":[
{
"@odata.type":"#microsoft.graph.commsNotification",
"changeType":"deleted",
"resource":"/app/calls/ab6233a5-20b7-4c5e-bea2-ce56c9776429/operations/eec3812a-fdc3-4fb4-825c-a06c9f35414e",
"resourceUrl":"/communications/calls/ab6233a5-20b7-4c5e-bea2-ce56c9776429/operations/eec3812a-fdc3-4fb4-825c-a06c9f35414e",
"resourceData":{
"@odata.type":"#microsoft.graph.inviteParticipantsOperation",
"participants":[
{
"@odata.type":"#microsoft.graph.invitationParticipantInfo",
"identity":{
"@odata.type":"#microsoft.graph.identitySet",
"user":{
"@odata.type":"#microsoft.graph.identity",
"id":"278405a3-f568-4b3e-b684-009193463064",
"displayName": "string"
}
}
}
],
"status":"completed",
"clientContext":"f2fa86af-3c51-4bc2-8fc0-475452d9764f",
"id":"eec3812a-fdc3-4fb4-825c-a06c9f35414e"
}
}
]
}
Notification - roster updated with participant added
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type":"#microsoft.graph.commsNotifications",
"value":[
{
"@odata.type":"#microsoft.graph.commsNotification",
"changeType":"updated",
"resource":"/app/calls/ab6233a5-20b7-4c5e-bea2-ce56c9776429/participants",
"resourceUrl":"/communications/calls/ab6233a5-20b7-4c5e-bea2-ce56c9776429/participants",
"resourceData":[
{
"@odata.type":"#microsoft.graph.participant",
"info":{
"@odata.type":"#microsoft.graph.invitationParticipantInfo",
"identity":{
"@odata.type":"#microsoft.graph.identitySet",
"application":{
"@odata.type":"#microsoft.graph.identity",
"id":"278405a3-f568-4b3e-b684-009193463064"
}
},
"endpointType":"default"
},
"mediaStreams":[
{
"@odata.type":"#microsoft.graph.mediaStream",
"mediaType":"audio",
"sourceId":"1",
"direction":"sendReceive",
"serverMuted":false
}
],
"isMuted":false,
"isInLobby":false,
"id":null
}
]
}
]
}
Example 2: Invite multiple participants to an existing group call
Note : The existing group call must have a valid chatInfo . Inviting up to 5 participants is supported.
Request
POST /communications/calls/7531d31f-d10d-44de-802f-c569dbca451c/participants/invite
Content-Type: application/json
{
"participants": [
{
"@odata.type": "#microsoft.graph.invitationParticipantInfo",
"replacesCallId": "a7ebfb2d-871e-419c-87af-27290b22e8db",
"identity": {
"@odata.type": "#microsoft.graph.identitySet",
"user": {
"@odata.type": "#microsoft.graph.identity",
"id": "7e1b4346-85a6-4bdd-abe3-d11c5d420efe",
"displayName": "string"
}
}
},
{
"@odata.type": "#microsoft.graph.invitationParticipantInfo",
"replacesCallId": "a7ebfb2d-871e-419c-87af-27290b22e8db",
"identity": {
"@odata.type": "#microsoft.graph.identitySet",
"user": {
"@odata.type": "#microsoft.graph.identity",
"id": "1e126418-44a0-4a94-a6f8-0efe1ad71acb",
"displayName": "string"
}
}
}
],
"clientContext": "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Communications.Calls.Item.Participants.Invite.InvitePostRequestBody
{
Participants = new List<InvitationParticipantInfo>
{
new InvitationParticipantInfo
{
OdataType = "#microsoft.graph.invitationParticipantInfo",
ReplacesCallId = "a7ebfb2d-871e-419c-87af-27290b22e8db",
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
User = new Identity
{
OdataType = "#microsoft.graph.identity",
Id = "7e1b4346-85a6-4bdd-abe3-d11c5d420efe",
DisplayName = "string",
},
},
},
new InvitationParticipantInfo
{
OdataType = "#microsoft.graph.invitationParticipantInfo",
ReplacesCallId = "a7ebfb2d-871e-419c-87af-27290b22e8db",
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
User = new Identity
{
OdataType = "#microsoft.graph.identity",
Id = "1e126418-44a0-4a94-a6f8-0efe1ad71acb",
DisplayName = "string",
},
},
},
},
ClientContext = "f2fa86af-3c51-4bc2-8fc0-475452d9764f",
};
var result = await graphClient.Communications.Calls["{call-id}"].Participants.Invite.PostAsync(requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc communications calls participants invite post --call-id {call-id} --body '{\
"participants": [\
{\
"@odata.type": "#microsoft.graph.invitationParticipantInfo",\
"replacesCallId": "a7ebfb2d-871e-419c-87af-27290b22e8db",\
"identity": {\
"@odata.type": "#microsoft.graph.identitySet",\
"user": {\
"@odata.type": "#microsoft.graph.identity",\
"id": "7e1b4346-85a6-4bdd-abe3-d11c5d420efe",\
"displayName": "string"\
}\
}\
},\
{\
"@odata.type": "#microsoft.graph.invitationParticipantInfo",\
"replacesCallId": "a7ebfb2d-871e-419c-87af-27290b22e8db",\
"identity": {\
"@odata.type": "#microsoft.graph.identitySet",\
"user": {\
"@odata.type": "#microsoft.graph.identity",\
"id": "1e126418-44a0-4a94-a6f8-0efe1ad71acb",\
"displayName": "string"\
}\
}\
}\
],\
"clientContext": "f2fa86af-3c51-4bc2-8fc0-475452d9764f"\
}\
'
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphcommunications "github.com/microsoftgraph/msgraph-sdk-go/communications"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphcommunications.NewInvitePostRequestBody()
invitationParticipantInfo := graphmodels.NewInvitationParticipantInfo()
replacesCallId := "a7ebfb2d-871e-419c-87af-27290b22e8db"
invitationParticipantInfo.SetReplacesCallId(&replacesCallId)
identity := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
id := "7e1b4346-85a6-4bdd-abe3-d11c5d420efe"
user.SetId(&id)
displayName := "string"
user.SetDisplayName(&displayName)
identity.SetUser(user)
invitationParticipantInfo.SetIdentity(identity)
invitationParticipantInfo1 := graphmodels.NewInvitationParticipantInfo()
replacesCallId := "a7ebfb2d-871e-419c-87af-27290b22e8db"
invitationParticipantInfo1.SetReplacesCallId(&replacesCallId)
identity := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
id := "1e126418-44a0-4a94-a6f8-0efe1ad71acb"
user.SetId(&id)
displayName := "string"
user.SetDisplayName(&displayName)
identity.SetUser(user)
invitationParticipantInfo1.SetIdentity(identity)
participants := []graphmodels.InvitationParticipantInfoable {
invitationParticipantInfo,
invitationParticipantInfo1,
}
requestBody.SetParticipants(participants)
clientContext := "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
requestBody.SetClientContext(&clientContext)
invite, err := graphClient.Communications().Calls().ByCallId("call-id").Participants().Invite().Post(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
LinkedList<InvitationParticipantInfo> participantsList = new LinkedList<InvitationParticipantInfo>();
InvitationParticipantInfo participants = new InvitationParticipantInfo();
participants.replacesCallId = "a7ebfb2d-871e-419c-87af-27290b22e8db";
IdentitySet identity = new IdentitySet();
Identity user = new Identity();
user.id = "7e1b4346-85a6-4bdd-abe3-d11c5d420efe";
user.displayName = "string";
identity.user = user;
participants.identity = identity;
participantsList.add(participants);
InvitationParticipantInfo participants1 = new InvitationParticipantInfo();
participants1.replacesCallId = "a7ebfb2d-871e-419c-87af-27290b22e8db";
IdentitySet identity1 = new IdentitySet();
Identity user1 = new Identity();
user1.id = "1e126418-44a0-4a94-a6f8-0efe1ad71acb";
user1.displayName = "string";
identity1.user = user1;
participants1.identity = identity1;
participantsList.add(participants1);
String clientContext = "f2fa86af-3c51-4bc2-8fc0-475452d9764f";
graphClient.communications().calls("7531d31f-d10d-44de-802f-c569dbca451c").participants()
.invite(ParticipantInviteParameterSet
.newBuilder()
.withParticipants(participantsList)
.withClientContext(clientContext)
.build())
.buildRequest()
.post();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
const options = {
authProvider,
};
const client = Client.init(options);
const inviteParticipantsOperation = {
participants: [
{
'@odata.type': '#microsoft.graph.invitationParticipantInfo',
replacesCallId: 'a7ebfb2d-871e-419c-87af-27290b22e8db',
identity: {
'@odata.type': '#microsoft.graph.identitySet',
user: {
'@odata.type': '#microsoft.graph.identity',
id: '7e1b4346-85a6-4bdd-abe3-d11c5d420efe',
displayName: 'string'
}
}
},
{
'@odata.type': '#microsoft.graph.invitationParticipantInfo',
replacesCallId: 'a7ebfb2d-871e-419c-87af-27290b22e8db',
identity: {
'@odata.type': '#microsoft.graph.identitySet',
user: {
'@odata.type': '#microsoft.graph.identity',
id: '1e126418-44a0-4a94-a6f8-0efe1ad71acb',
displayName: 'string'
}
}
}
],
clientContext: 'f2fa86af-3c51-4bc2-8fc0-475452d9764f'
};
await client.api('/communications/calls/7531d31f-d10d-44de-802f-c569dbca451c/participants/invite')
.post(inviteParticipantsOperation);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new InvitePostRequestBody();
$participantsInvitationParticipantInfo1 = new InvitationParticipantInfo();
$participantsInvitationParticipantInfo1->setOdataType('#microsoft.graph.invitationParticipantInfo');
$participantsInvitationParticipantInfo1->setReplacesCallId('a7ebfb2d-871e-419c-87af-27290b22e8db');
$participantsInvitationParticipantInfo1Identity = new IdentitySet();
$participantsInvitationParticipantInfo1Identity->setOdataType('#microsoft.graph.identitySet');
$participantsInvitationParticipantInfo1IdentityUser = new Identity();
$participantsInvitationParticipantInfo1IdentityUser->setOdataType('#microsoft.graph.identity');
$participantsInvitationParticipantInfo1IdentityUser->setId('7e1b4346-85a6-4bdd-abe3-d11c5d420efe');
$participantsInvitationParticipantInfo1IdentityUser->setDisplayName('string');
$participantsInvitationParticipantInfo1Identity->setUser($participantsInvitationParticipantInfo1IdentityUser);
$participantsInvitationParticipantInfo1->setIdentity($participantsInvitationParticipantInfo1Identity);
$participantsArray []= $participantsInvitationParticipantInfo1;
$participantsInvitationParticipantInfo2 = new InvitationParticipantInfo();
$participantsInvitationParticipantInfo2->setOdataType('#microsoft.graph.invitationParticipantInfo');
$participantsInvitationParticipantInfo2->setReplacesCallId('a7ebfb2d-871e-419c-87af-27290b22e8db');
$participantsInvitationParticipantInfo2Identity = new IdentitySet();
$participantsInvitationParticipantInfo2Identity->setOdataType('#microsoft.graph.identitySet');
$participantsInvitationParticipantInfo2IdentityUser = new Identity();
$participantsInvitationParticipantInfo2IdentityUser->setOdataType('#microsoft.graph.identity');
$participantsInvitationParticipantInfo2IdentityUser->setId('1e126418-44a0-4a94-a6f8-0efe1ad71acb');
$participantsInvitationParticipantInfo2IdentityUser->setDisplayName('string');
$participantsInvitationParticipantInfo2Identity->setUser($participantsInvitationParticipantInfo2IdentityUser);
$participantsInvitationParticipantInfo2->setIdentity($participantsInvitationParticipantInfo2Identity);
$participantsArray []= $participantsInvitationParticipantInfo2;
$requestBody->setParticipants($participantsArray);
$requestBody->setClientContext('f2fa86af-3c51-4bc2-8fc0-475452d9764f');
$result = $graphServiceClient->communications()->calls()->byCallId('call-id')->participants()->invite()->post($requestBody)->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Import-Module Microsoft.Graph.CloudCommunications
$params = @{
participants = @(
@{
"@odata.type" = "#microsoft.graph.invitationParticipantInfo"
replacesCallId = "a7ebfb2d-871e-419c-87af-27290b22e8db"
identity = @{
"@odata.type" = "#microsoft.graph.identitySet"
user = @{
"@odata.type" = "#microsoft.graph.identity"
id = "7e1b4346-85a6-4bdd-abe3-d11c5d420efe"
displayName = "string"
}
}
}
@{
"@odata.type" = "#microsoft.graph.invitationParticipantInfo"
replacesCallId = "a7ebfb2d-871e-419c-87af-27290b22e8db"
identity = @{
"@odata.type" = "#microsoft.graph.identitySet"
user = @{
"@odata.type" = "#microsoft.graph.identity"
id = "1e126418-44a0-4a94-a6f8-0efe1ad71acb"
displayName = "string"
}
}
}
)
clientContext = "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
}
Invoke-MgInviteCommunicationCallParticipant -CallId $callId -BodyParameter $params
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = InvitePostRequestBody(
participants = [
InvitationParticipantInfo(
odata_type = "#microsoft.graph.invitationParticipantInfo",
replaces_call_id = "a7ebfb2d-871e-419c-87af-27290b22e8db",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
user = Identity(
odata_type = "#microsoft.graph.identity",
id = "7e1b4346-85a6-4bdd-abe3-d11c5d420efe",
display_name = "string",
),
),
),
InvitationParticipantInfo(
odata_type = "#microsoft.graph.invitationParticipantInfo",
replaces_call_id = "a7ebfb2d-871e-419c-87af-27290b22e8db",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
user = Identity(
odata_type = "#microsoft.graph.identity",
id = "1e126418-44a0-4a94-a6f8-0efe1ad71acb",
display_name = "string",
),
),
),
]
client_context = "f2fa86af-3c51-4bc2-8fc0-475452d9764f",
)
result = await graph_client.communications.calls.by_call_id('call-id').participants.invite.post(body = request_body)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.inviteParticipantsOperation",
"id":"eec3812a-fdc3-4fb4-825c-a06c9f35414e",
"status":"Running",
"clientContext":"f2fa86af-3c51-4bc2-8fc0-475452d9764f",
"resultInfo":null,
"participants":[
{
"endpointType":null,
"replacesCallId":null,
"identity":{
"user":{
"@odata.type": "#microsoft.graph.identity",
"id":"7e1b4346-85a6-4bdd-abe3-d11c5d420efe",
"displayName": "string"
},
"application":null,
"device":null,
"phone":null
}
},
{
"endpointType":null,
"replacesCallId":null,
"identity":{
"user":{
"@odata.type": "#microsoft.graph.identity",
"id":"1e126418-44a0-4a94-a6f8-0efe1ad71acb",
"displayName": "string"
},
"application":null,
"device":null,
"phone":null
}
}
]
}
Notification - operation completed
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "deleted",
"resource": "/communications/calls/7531d31f-d10d-44de-802f-c569dbca451c/operations/participants",
"resourceUrl": "/communications/calls/7531d31f-d10d-44de-802f-c569dbca451c/operations/participants",
"resourceData": {
"@odata.type": "#microsoft.graph.inviteParticipantsOperation",
"participants": [
{
"@odata.type": "#microsoft.graph.invitationParticipantInfo",
"identity": {
"@odata.type": "#microsoft.graph.identitySet",
"user":{
"@odata.type": "#microsoft.graph.identity",
"id":"7e1b4346-85a6-4bdd-abe3-d11c5d420efe",
"displayName": "string"
}
}
},
{
"@odata.type": "#microsoft.graph.invitationParticipantInfo",
"identity": {
"@odata.type": "#microsoft.graph.identitySet",
"user":{
"@odata.type": "#microsoft.graph.identity",
"id":"1e126418-44a0-4a94-a6f8-0efe1ad71acb",
"displayName": "string"
}
}
}
],
"status": "completed",
"clientContext": "f2fa86af-3c51-4bc2-8fc0-475452d9764f",
"id": null
}
}
]
}
Notification - roster updated with participants added
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "updated",
"resource": "/app/calls/7531d31f-d10d-44de-802f-c569dbca451c/operations/participants",
"resourceUrl": "/communications/calls/7531d31f-d10d-44de-802f-c569dbca451c/operations/participants",
"resourceData": [
{
"@odata.type": "#microsoft.graph.participant",
"info": {
"@odata.type": "#microsoft.graph.invitationParticipantInfo",
"identity": {
"@odata.type": "#microsoft.graph.identitySet",
"application": {
"@odata.type": "#microsoft.graph.identity",
"id": "7e1b4346-85a6-4bdd-abe3-d11c5d420efe"
}
},
"endpointType": "default"
},
"mediaStreams": [
{
"@odata.type": "#microsoft.graph.mediaStream",
"mediaType": "audio",
"sourceId": "1",
"direction": "sendReceive",
"serverMuted": false
}
],
"isMuted": false,
"isInLobby": false,
"id": null
},
{
"@odata.type": "#microsoft.graph.participant",
"info": {
"@odata.type": "#microsoft.graph.invitationParticipantInfo",
"identity": {
"@odata.type": "#microsoft.graph.identitySet",
"user":{
"@odata.type": "#microsoft.graph.identity",
"id":"1e126418-44a0-4a94-a6f8-0efe1ad71acb",
"displayName": "string"
}
},
"endpointType": "default"
},
"mediaStreams": [
{
"@odata.type": "#microsoft.graph.mediaStream",
"mediaType": "audio",
"sourceId": "3",
"direction": "sendReceive",
"serverMuted": false
}
],
"isMuted": false,
"isInLobby": false,
"id": null
}
]
}
]
}
Example 3: Invite participants to an existing group call, replacing an existing Peer-to-Peer call
The invite API supports only one participant when replacing an existing peer-to-peer call.
When multiple participants are provided in the request body, only the first participant
will be read and the rest of the participants will be ignored.
Note: The invite API supports only one participant when replacesCallId is provided.
For details about using replacesCallId to replace an existing peer-to-peer call,
see invitationParticipantInfo .
Request
POST /communications/calls/ab6233a5-20b7-4c5e-bea2-ce56c9776429/participants/invite
Content-Type: application/json
{
"participants": [
{
"@odata.type": "#microsoft.graph.invitationParticipantInfo",
"replacesCallId": "a7ebfb2d-871e-419c-87af-27290b22e8db",
"identity": {
"@odata.type": "#microsoft.graph.identitySet",
"user": {
"@odata.type": "#microsoft.graph.identity",
"id": "7e1b4346-85a6-4bdd-abe3-d11c5d420efe",
"displayName": "string"
}
}
}
],
"clientContext": "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Communications.Calls.Item.Participants.Invite.InvitePostRequestBody
{
Participants = new List<InvitationParticipantInfo>
{
new InvitationParticipantInfo
{
OdataType = "#microsoft.graph.invitationParticipantInfo",
ReplacesCallId = "a7ebfb2d-871e-419c-87af-27290b22e8db",
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
User = new Identity
{
OdataType = "#microsoft.graph.identity",
Id = "7e1b4346-85a6-4bdd-abe3-d11c5d420efe",
DisplayName = "string",
},
},
},
},
ClientContext = "f2fa86af-3c51-4bc2-8fc0-475452d9764f",
};
var result = await graphClient.Communications.Calls["{call-id}"].Participants.Invite.PostAsync(requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc communications calls participants invite post --call-id {call-id} --body '{\
"participants": [\
{\
"@odata.type": "#microsoft.graph.invitationParticipantInfo",\
"replacesCallId": "a7ebfb2d-871e-419c-87af-27290b22e8db",\
"identity": {\
"@odata.type": "#microsoft.graph.identitySet",\
"user": {\
"@odata.type": "#microsoft.graph.identity",\
"id": "7e1b4346-85a6-4bdd-abe3-d11c5d420efe",\
"displayName": "string"\
}\
}\
}\
],\
"clientContext": "f2fa86af-3c51-4bc2-8fc0-475452d9764f"\
}\
'
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphcommunications "github.com/microsoftgraph/msgraph-sdk-go/communications"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphcommunications.NewInvitePostRequestBody()
invitationParticipantInfo := graphmodels.NewInvitationParticipantInfo()
replacesCallId := "a7ebfb2d-871e-419c-87af-27290b22e8db"
invitationParticipantInfo.SetReplacesCallId(&replacesCallId)
identity := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
id := "7e1b4346-85a6-4bdd-abe3-d11c5d420efe"
user.SetId(&id)
displayName := "string"
user.SetDisplayName(&displayName)
identity.SetUser(user)
invitationParticipantInfo.SetIdentity(identity)
participants := []graphmodels.InvitationParticipantInfoable {
invitationParticipantInfo,
}
requestBody.SetParticipants(participants)
clientContext := "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
requestBody.SetClientContext(&clientContext)
invite, err := graphClient.Communications().Calls().ByCallId("call-id").Participants().Invite().Post(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
LinkedList<InvitationParticipantInfo> participantsList = new LinkedList<InvitationParticipantInfo>();
InvitationParticipantInfo participants = new InvitationParticipantInfo();
participants.replacesCallId = "a7ebfb2d-871e-419c-87af-27290b22e8db";
IdentitySet identity = new IdentitySet();
Identity user = new Identity();
user.id = "7e1b4346-85a6-4bdd-abe3-d11c5d420efe";
user.displayName = "string";
identity.user = user;
participants.identity = identity;
participantsList.add(participants);
String clientContext = "f2fa86af-3c51-4bc2-8fc0-475452d9764f";
graphClient.communications().calls("ab6233a5-20b7-4c5e-bea2-ce56c9776429").participants()
.invite(ParticipantInviteParameterSet
.newBuilder()
.withParticipants(participantsList)
.withClientContext(clientContext)
.build())
.buildRequest()
.post();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
const options = {
authProvider,
};
const client = Client.init(options);
const inviteParticipantsOperation = {
participants: [
{
'@odata.type': '#microsoft.graph.invitationParticipantInfo',
replacesCallId: 'a7ebfb2d-871e-419c-87af-27290b22e8db',
identity: {
'@odata.type': '#microsoft.graph.identitySet',
user: {
'@odata.type': '#microsoft.graph.identity',
id: '7e1b4346-85a6-4bdd-abe3-d11c5d420efe',
displayName: 'string'
}
}
}
],
clientContext: 'f2fa86af-3c51-4bc2-8fc0-475452d9764f'
};
await client.api('/communications/calls/ab6233a5-20b7-4c5e-bea2-ce56c9776429/participants/invite')
.post(inviteParticipantsOperation);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new InvitePostRequestBody();
$participantsInvitationParticipantInfo1 = new InvitationParticipantInfo();
$participantsInvitationParticipantInfo1->setOdataType('#microsoft.graph.invitationParticipantInfo');
$participantsInvitationParticipantInfo1->setReplacesCallId('a7ebfb2d-871e-419c-87af-27290b22e8db');
$participantsInvitationParticipantInfo1Identity = new IdentitySet();
$participantsInvitationParticipantInfo1Identity->setOdataType('#microsoft.graph.identitySet');
$participantsInvitationParticipantInfo1IdentityUser = new Identity();
$participantsInvitationParticipantInfo1IdentityUser->setOdataType('#microsoft.graph.identity');
$participantsInvitationParticipantInfo1IdentityUser->setId('7e1b4346-85a6-4bdd-abe3-d11c5d420efe');
$participantsInvitationParticipantInfo1IdentityUser->setDisplayName('string');
$participantsInvitationParticipantInfo1Identity->setUser($participantsInvitationParticipantInfo1IdentityUser);
$participantsInvitationParticipantInfo1->setIdentity($participantsInvitationParticipantInfo1Identity);
$participantsArray []= $participantsInvitationParticipantInfo1;
$requestBody->setParticipants($participantsArray);
$requestBody->setClientContext('f2fa86af-3c51-4bc2-8fc0-475452d9764f');
$result = $graphServiceClient->communications()->calls()->byCallId('call-id')->participants()->invite()->post($requestBody)->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Import-Module Microsoft.Graph.CloudCommunications
$params = @{
participants = @(
@{
"@odata.type" = "#microsoft.graph.invitationParticipantInfo"
replacesCallId = "a7ebfb2d-871e-419c-87af-27290b22e8db"
identity = @{
"@odata.type" = "#microsoft.graph.identitySet"
user = @{
"@odata.type" = "#microsoft.graph.identity"
id = "7e1b4346-85a6-4bdd-abe3-d11c5d420efe"
displayName = "string"
}
}
}
)
clientContext = "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
}
Invoke-MgInviteCommunicationCallParticipant -CallId $callId -BodyParameter $params
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = InvitePostRequestBody(
participants = [
InvitationParticipantInfo(
odata_type = "#microsoft.graph.invitationParticipantInfo",
replaces_call_id = "a7ebfb2d-871e-419c-87af-27290b22e8db",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
user = Identity(
odata_type = "#microsoft.graph.identity",
id = "7e1b4346-85a6-4bdd-abe3-d11c5d420efe",
display_name = "string",
),
),
),
]
client_context = "f2fa86af-3c51-4bc2-8fc0-475452d9764f",
)
result = await graph_client.communications.calls.by_call_id('call-id').participants.invite.post(body = request_body)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.inviteParticipantsOperation",
"id": "278405a3-f568-4b3e-b684-009193463064",
"status": "Running",
"clientContext": "f2fa86af-3c51-4bc2-8fc0-475452d9764f",
"resultInfo": null,
"participants": [
{
"endpointType": null,
"replacesCallId": "a7ebfb2d-871e-419c-87af-27290b22e8db",
"identity": {
"user": {
"@odata.type": "#microsoft.graph.identity",
"id": "7e1b4346-85a6-4bdd-abe3-d11c5d420efe",
"displayName": "Participant"
},
"application": null,
"device": null,
"phone": null
}
}
]
}
Notification - operation completed
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type":"#microsoft.graph.commsNotifications",
"value":[
{
"@odata.type":"#microsoft.graph.commsNotification",
"changeType":"deleted",
"resource":"/app/calls/ab6233a5-20b7-4c5e-bea2-ce56c9776429/operations/278405a3-f568-4b3e-b684-009193463064",
"resourceUrl":"/communications/calls/ab6233a5-20b7-4c5e-bea2-ce56c9776429/operations/278405a3-f568-4b3e-b684-009193463064",
"resourceData":{
"@odata.type":"#microsoft.graph.inviteParticipantsOperation",
"participants":[
{
"@odata.type":"#microsoft.graph.invitationParticipantInfo",
"identity":{
"@odata.type":"#microsoft.graph.identitySet",
"user":{
"@odata.type":"#microsoft.graph.identity",
"id":"7e1b4346-85a6-4bdd-abe3-d11c5d420efe",
"displayName": "string"
}
}
}
],
"status":"completed",
"clientContext":"f2fa86af-3c51-4bc2-8fc0-475452d9764f",
"id":"278405a3-f568-4b3e-b684-009193463064"
}
}
]
}
Notification - roster updated with participant added
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type":"#microsoft.graph.commsNotifications",
"value":[
{
"@odata.type":"#microsoft.graph.commsNotification",
"changeType":"updated",
"resource":"/communications/calls/a7ebfb2d-871e-419c-87af-27290b22e8db/participants",
"resourceUrl":"/communications/calls/a7ebfb2d-871e-419c-87af-27290b22e8db/participants",
"resourceData":[
{
"@odata.type":"#microsoft.graph.participant",
"info":{
"@odata.type":"#microsoft.graph.invitationParticipantInfo",
"identity":{
"@odata.type":"#microsoft.graph.identitySet",
"user":{
"@odata.type":"#microsoft.graph.identity",
"id":"7e1b4346-85a6-4bdd-abe3-d11c5d420efe",
"displayName": "string"
}
},
"endpointType":"default"
},
"mediaStreams":[
{
"@odata.type":"#microsoft.graph.mediaStream",
"mediaType":"audio",
"sourceId":"1",
"direction":"sendReceive",
"serverMuted":false
}
],
"isMuted":false,
"isInLobby":false,
"id":null
}
]
}
]
}
Note: With a "completed" status, you can expect to receive notifications on how your original peer-to-peer call has been terminated and deleted.
Example 4: Invite one PSTN participant to an existing call
This call requires an application instance with a PSTN number assigned. For details, see Assign a phone number to your bot .
Note: Phone ID is the phone number in E.164 format.
Request
POST /communications/calls/{id}/participants/invite
Content-Type: application/json
Content-Length: 464
{
"participants": [
{
"@odata.type": "#microsoft.graph.invitationParticipantInfo",
"identity": {
"@odata.type": "#microsoft.graph.identitySet",
"phone": {
"@odata.type": "#microsoft.graph.identity",
"id": "+12345678901"
}
}
}
],
"clientContext": "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Communications.Calls.Item.Participants.Invite.InvitePostRequestBody
{
Participants = new List<InvitationParticipantInfo>
{
new InvitationParticipantInfo
{
OdataType = "#microsoft.graph.invitationParticipantInfo",
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
AdditionalData = new Dictionary<string, object>
{
{
"phone" , new
{
OdataType = "#microsoft.graph.identity",
Id = "+12345678901",
}
},
},
},
},
},
ClientContext = "f2fa86af-3c51-4bc2-8fc0-475452d9764f",
};
var result = await graphClient.Communications.Calls["{call-id}"].Participants.Invite.PostAsync(requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc communications calls participants invite post --call-id {call-id} --body '{\
"participants": [\
{\
"@odata.type": "#microsoft.graph.invitationParticipantInfo",\
"identity": {\
"@odata.type": "#microsoft.graph.identitySet",\
"phone": {\
"@odata.type": "#microsoft.graph.identity",\
"id": "+12345678901"\
}\
}\
}\
],\
"clientContext": "f2fa86af-3c51-4bc2-8fc0-475452d9764f"\
}\
'
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphcommunications "github.com/microsoftgraph/msgraph-sdk-go/communications"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphcommunications.NewInvitePostRequestBody()
invitationParticipantInfo := graphmodels.NewInvitationParticipantInfo()
identity := graphmodels.NewIdentitySet()
additionalData := map[string]interface{}{
phone := graphmodels.New()
id := "+12345678901"
phone.SetId(&id)
identity.SetPhone(phone)
}
identity.SetAdditionalData(additionalData)
invitationParticipantInfo.SetIdentity(identity)
participants := []graphmodels.InvitationParticipantInfoable {
invitationParticipantInfo,
}
requestBody.SetParticipants(participants)
clientContext := "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
requestBody.SetClientContext(&clientContext)
invite, err := graphClient.Communications().Calls().ByCallId("call-id").Participants().Invite().Post(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
const options = {
authProvider,
};
const client = Client.init(options);
const inviteParticipantsOperation = {
participants: [
{
'@odata.type': '#microsoft.graph.invitationParticipantInfo',
identity: {
'@odata.type': '#microsoft.graph.identitySet',
phone: {
'@odata.type': '#microsoft.graph.identity',
id: '+12345678901'
}
}
}
],
clientContext: 'f2fa86af-3c51-4bc2-8fc0-475452d9764f'
};
await client.api('/communications/calls/{id}/participants/invite')
.post(inviteParticipantsOperation);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new InvitePostRequestBody();
$participantsInvitationParticipantInfo1 = new InvitationParticipantInfo();
$participantsInvitationParticipantInfo1->setOdataType('#microsoft.graph.invitationParticipantInfo');
$participantsInvitationParticipantInfo1Identity = new IdentitySet();
$participantsInvitationParticipantInfo1Identity->setOdataType('#microsoft.graph.identitySet');
$additionalData = [
'phone' => [
'@odata.type' => '#microsoft.graph.identity',
'id' => '+12345678901',
],
];
$participantsInvitationParticipantInfo1Identity->setAdditionalData($additionalData);
$participantsInvitationParticipantInfo1->setIdentity($participantsInvitationParticipantInfo1Identity);
$participantsArray []= $participantsInvitationParticipantInfo1;
$requestBody->setParticipants($participantsArray);
$requestBody->setClientContext('f2fa86af-3c51-4bc2-8fc0-475452d9764f');
$result = $graphServiceClient->communications()->calls()->byCallId('call-id')->participants()->invite()->post($requestBody)->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Import-Module Microsoft.Graph.CloudCommunications
$params = @{
participants = @(
@{
"@odata.type" = "#microsoft.graph.invitationParticipantInfo"
identity = @{
"@odata.type" = "#microsoft.graph.identitySet"
phone = @{
"@odata.type" = "#microsoft.graph.identity"
id = "+12345678901"
}
}
}
)
clientContext = "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
}
Invoke-MgInviteCommunicationCallParticipant -CallId $callId -BodyParameter $params
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = InvitePostRequestBody(
participants = [
InvitationParticipantInfo(
odata_type = "#microsoft.graph.invitationParticipantInfo",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
additional_data = {
"phone" : (
odata_type = "#microsoft.graph.identity",
id = "+12345678901",
),
}
),
),
]
client_context = "f2fa86af-3c51-4bc2-8fc0-475452d9764f",
)
result = await graph_client.communications.calls.by_call_id('call-id').participants.invite.post(body = request_body)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Response
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.inviteParticipantsOperation",
"id": "eec3812a-fdc3-4fb4-825c-a06c9f35414e",
"status": "Running",
"clientContext": "f2fa86af-3c51-4bc2-8fc0-475452d9764f",
"resultInfo": null,
"participants": [
{
"endpointType": null,
"id": null,
"replacesCallId": null,
"identity": {
"user": null,
"guest": null,
"encrypted": null,
"onPremises": null,
"applicationInstance": null,
"application": null,
"device": null,
"phone": {
"@odata.type": "#microsoft.graph.identity",
"id": "+12345678901"
}
}
}
]
}
Notification - operation completed
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type":"#microsoft.graph.commsNotifications",
"value":[
{
"@odata.type":"#microsoft.graph.commsNotification",
"changeType":"deleted",
"resource":"/app/calls/ab6233a5-20b7-4c5e-bea2-ce56c9776429/operations/eec3812a-fdc3-4fb4-825c-a06c9f35414e",
"resourceUrl":"/communications/calls/ab6233a5-20b7-4c5e-bea2-ce56c9776429/operations/eec3812a-fdc3-4fb4-825c-a06c9f35414e",
"resourceData":{
"@odata.type":"#microsoft.graph.inviteParticipantsOperation",
"participants":[
{
"@odata.type":"#microsoft.graph.invitationParticipantInfo",
"identity":{
"@odata.type":"#microsoft.graph.identitySet",
"phone": {
"@odata.type": "#microsoft.graph.identity",
"id": "+12345678901"
}
}
}
],
"status":"completed",
"clientContext":"f2fa86af-3c51-4bc2-8fc0-475452d9764f",
"id":"eec3812a-fdc3-4fb4-825c-a06c9f35414e"
}
}
]
}
Notification - roster updated with participant added
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type":"#microsoft.graph.commsNotifications",
"value":[
{
"@odata.type":"#microsoft.graph.commsNotification",
"changeType":"updated",
"resource":"/app/calls/ab6233a5-20b7-4c5e-bea2-ce56c9776429/participants",
"resourceUrl":"/communications/calls/ab6233a5-20b7-4c5e-bea2-ce56c9776429/participants",
"resourceData":[
{
"@odata.type":"#microsoft.graph.participant",
"info":{
"@odata.type":"#microsoft.graph.participantInfo",
"identity":{
"@odata.type":"#microsoft.graph.identitySet",
"phone": {
"@odata.type": "#microsoft.graph.identity",
"id": "+12345678901"
}
},
"endpointType":"default"
},
"mediaStreams":[
{
"@odata.type":"#microsoft.graph.mediaStream",
"mediaType":"audio",
"sourceId":"1",
"direction":"sendReceive",
"serverMuted":false
}
],
"isMuted":false,
"isInLobby":false,
"id":null
}
]
}
]
}
Note: With a completed status, you can expect to receive notifications about how your original peer-to-peer call has been terminated and deleted.
Example 5: Move one participant from one meeting to another
You can move one participant from one meeting to another if these two meetings have been created by the same application.
For more information about how to create an online meeting, see Create onlineMeeting .
Note: The invite API can move only one participate per request. If you provide more than one participant in the request body, the invite API will move only the first one.
Request
The following is an example of a request.
POST /communications/calls/ab6233a5-20b7-4c5e-bea2-ce56c9776429/participants/invite
Content-Type: application/json
{
"participants": [
{
"@odata.type": "#microsoft.graph.invitationParticipantInfo",
"replacesCallId": "a7ebfb2d-871e-419c-87af-27290b22e8db",
"participantId": "7d501bf1-5ee4-4605-ba92-0ae4513c611c",
"identity": {
"@odata.type": "#microsoft.graph.identitySet",
"user": {
"@odata.type": "#microsoft.graph.identity",
"id": "682b6c37-0729-4fab-ace6-d730d5d9137e",
"identityProvider": "AAD"
}
}
}
],
"clientContext": "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Communications.Calls.Item.Participants.Invite.InvitePostRequestBody
{
Participants = new List<InvitationParticipantInfo>
{
new InvitationParticipantInfo
{
OdataType = "#microsoft.graph.invitationParticipantInfo",
ReplacesCallId = "a7ebfb2d-871e-419c-87af-27290b22e8db",
ParticipantId = "7d501bf1-5ee4-4605-ba92-0ae4513c611c",
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
User = new Identity
{
OdataType = "#microsoft.graph.identity",
Id = "682b6c37-0729-4fab-ace6-d730d5d9137e",
AdditionalData = new Dictionary<string, object>
{
{
"identityProvider" , "AAD"
},
},
},
},
},
},
ClientContext = "f2fa86af-3c51-4bc2-8fc0-475452d9764f",
};
var result = await graphClient.Communications.Calls["{call-id}"].Participants.Invite.PostAsync(requestBody);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc communications calls participants invite post --call-id {call-id} --body '{\
"participants": [\
{\
"@odata.type": "#microsoft.graph.invitationParticipantInfo",\
"replacesCallId": "a7ebfb2d-871e-419c-87af-27290b22e8db",\
"participantId": "7d501bf1-5ee4-4605-ba92-0ae4513c611c",\
"identity": {\
"@odata.type": "#microsoft.graph.identitySet",\
"user": {\
"@odata.type": "#microsoft.graph.identity",\
"id": "682b6c37-0729-4fab-ace6-d730d5d9137e",\
"identityProvider": "AAD"\
}\
}\
}\
],\
"clientContext": "f2fa86af-3c51-4bc2-8fc0-475452d9764f"\
}\
'
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphcommunications "github.com/microsoftgraph/msgraph-sdk-go/communications"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphcommunications.NewInvitePostRequestBody()
invitationParticipantInfo := graphmodels.NewInvitationParticipantInfo()
replacesCallId := "a7ebfb2d-871e-419c-87af-27290b22e8db"
invitationParticipantInfo.SetReplacesCallId(&replacesCallId)
participantId := "7d501bf1-5ee4-4605-ba92-0ae4513c611c"
invitationParticipantInfo.SetParticipantId(&participantId)
identity := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
id := "682b6c37-0729-4fab-ace6-d730d5d9137e"
user.SetId(&id)
additionalData := map[string]interface{}{
"identityProvider" : "AAD",
}
user.SetAdditionalData(additionalData)
identity.SetUser(user)
invitationParticipantInfo.SetIdentity(identity)
participants := []graphmodels.InvitationParticipantInfoable {
invitationParticipantInfo,
}
requestBody.SetParticipants(participants)
clientContext := "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
requestBody.SetClientContext(&clientContext)
invite, err := graphClient.Communications().Calls().ByCallId("call-id").Participants().Invite().Post(context.Background(), requestBody, nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
const options = {
authProvider,
};
const client = Client.init(options);
const inviteParticipantsOperation = {
participants: [
{
'@odata.type': '#microsoft.graph.invitationParticipantInfo',
replacesCallId: 'a7ebfb2d-871e-419c-87af-27290b22e8db',
participantId: '7d501bf1-5ee4-4605-ba92-0ae4513c611c',
identity: {
'@odata.type': '#microsoft.graph.identitySet',
user: {
'@odata.type': '#microsoft.graph.identity',
id: '682b6c37-0729-4fab-ace6-d730d5d9137e',
identityProvider: 'AAD'
}
}
}
],
clientContext: 'f2fa86af-3c51-4bc2-8fc0-475452d9764f'
};
await client.api('/communications/calls/ab6233a5-20b7-4c5e-bea2-ce56c9776429/participants/invite')
.post(inviteParticipantsOperation);
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new InvitePostRequestBody();
$participantsInvitationParticipantInfo1 = new InvitationParticipantInfo();
$participantsInvitationParticipantInfo1->setOdataType('#microsoft.graph.invitationParticipantInfo');
$participantsInvitationParticipantInfo1->setReplacesCallId('a7ebfb2d-871e-419c-87af-27290b22e8db');
$participantsInvitationParticipantInfo1->setParticipantId('7d501bf1-5ee4-4605-ba92-0ae4513c611c');
$participantsInvitationParticipantInfo1Identity = new IdentitySet();
$participantsInvitationParticipantInfo1Identity->setOdataType('#microsoft.graph.identitySet');
$participantsInvitationParticipantInfo1IdentityUser = new Identity();
$participantsInvitationParticipantInfo1IdentityUser->setOdataType('#microsoft.graph.identity');
$participantsInvitationParticipantInfo1IdentityUser->setId('682b6c37-0729-4fab-ace6-d730d5d9137e');
$additionalData = [
'identityProvider' => 'AAD',
];
$participantsInvitationParticipantInfo1IdentityUser->setAdditionalData($additionalData);
$participantsInvitationParticipantInfo1Identity->setUser($participantsInvitationParticipantInfo1IdentityUser);
$participantsInvitationParticipantInfo1->setIdentity($participantsInvitationParticipantInfo1Identity);
$participantsArray []= $participantsInvitationParticipantInfo1;
$requestBody->setParticipants($participantsArray);
$requestBody->setClientContext('f2fa86af-3c51-4bc2-8fc0-475452d9764f');
$result = $graphServiceClient->communications()->calls()->byCallId('call-id')->participants()->invite()->post($requestBody)->wait();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Import-Module Microsoft.Graph.CloudCommunications
$params = @{
participants = @(
@{
"@odata.type" = "#microsoft.graph.invitationParticipantInfo"
replacesCallId = "a7ebfb2d-871e-419c-87af-27290b22e8db"
participantId = "7d501bf1-5ee4-4605-ba92-0ae4513c611c"
identity = @{
"@odata.type" = "#microsoft.graph.identitySet"
user = @{
"@odata.type" = "#microsoft.graph.identity"
id = "682b6c37-0729-4fab-ace6-d730d5d9137e"
identityProvider = "AAD"
}
}
}
)
clientContext = "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
}
Invoke-MgInviteCommunicationCallParticipant -CallId $callId -BodyParameter $params
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = InvitePostRequestBody(
participants = [
InvitationParticipantInfo(
odata_type = "#microsoft.graph.invitationParticipantInfo",
replaces_call_id = "a7ebfb2d-871e-419c-87af-27290b22e8db",
participant_id = "7d501bf1-5ee4-4605-ba92-0ae4513c611c",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
user = Identity(
odata_type = "#microsoft.graph.identity",
id = "682b6c37-0729-4fab-ace6-d730d5d9137e",
additional_data = {
"identity_provider" : "AAD",
}
),
),
),
]
client_context = "f2fa86af-3c51-4bc2-8fc0-475452d9764f",
)
result = await graph_client.communications.calls.by_call_id('call-id').participants.invite.post(body = request_body)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Response
The following is an example of the response.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.inviteParticipantsOperation",
"id": "278405a3-f568-4b3e-b684-009193463064",
"status": "Running",
"clientContext": "f2fa86af-3c51-4bc2-8fc0-475452d9764f",
"resultInfo": null,
"participants": [
{
"endpointType": null,
"id": null,
"replacesCallId": "a7ebfb2d-871e-419c-87af-27290b22e8db",
"participantId": "7d501bf1-5ee4-4605-ba92-0ae4513c611c",
"identity": {
"user": {
"id": "682b6c37-0729-4fab-ace6-d730d5d9137e",
"displayName": "Participant",
"identityProvider": "AAD",
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47"
},
"application": null,
"device": null,
"phone": null
}
}
]
}
Notification - operation completed
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type":"#microsoft.graph.commsNotifications",
"value":[
{
"@odata.type":"#microsoft.graph.commsNotification",
"changeType":"deleted",
"resource":"/app/calls/ab6233a5-20b7-4c5e-bea2-ce56c9776429/operations/278405a3-f568-4b3e-b684-009193463064",
"resourceUrl":"/communications/calls/ab6233a5-20b7-4c5e-bea2-ce56c9776429/operations/278405a3-f568-4b3e-b684-009193463064",
"resourceData":{
"@odata.type":"#microsoft.graph.inviteParticipantsOperation",
"participants":[
{
"@odata.type":"#microsoft.graph.invitationParticipantInfo",
"identity":{
"@odata.type":"#microsoft.graph.identitySet",
"user":{
"@odata.type":"#microsoft.graph.identity",
"id":"682b6c37-0729-4fab-ace6-d730d5d9137e",
"identityProvider":"AAD",
"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47"
}
}
}
],
"status":"completed",
"clientContext":"f2fa86af-3c51-4bc2-8fc0-475452d9764f",
"id":"278405a3-f568-4b3e-b684-009193463064"
}
}
]
}
Notification - roster updated with participant added
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type":"#microsoft.graph.commsNotifications",
"value":[
{
"@odata.type":"#microsoft.graph.commsNotification",
"changeType":"updated",
"resource":"/communications/calls/ab6233a5-20b7-4c5e-bea2-ce56c9776429/participants",
"resourceUrl":"/communications/calls/ab6233a5-20b7-4c5e-bea2-ce56c9776429/participants",
"resourceData":[
{
"@odata.type":"#microsoft.graph.participant",
"info":{
"@odata.type":"#microsoft.graph.participantInfo",
"identity":{
"@odata.type":"#microsoft.graph.identitySet",
"user":{
"@odata.type":"#microsoft.graph.identity",
"id":"682b6c37-0729-4fab-ace6-d730d5d9137e",
"identityProvider":"AAD",
"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47"
}
},
"endpointType":"default"
},
"mediaStreams":[
{
"@odata.type":"#microsoft.graph.mediaStream",
"mediaType":"audio",
"sourceId":"1",
"direction":"sendReceive",
"serverMuted":false
}
],
"isMuted":false,
"isInLobby":false,
"id":null
}
]
}
]
}