删除参与者
本文内容
删除呼叫中的特定参与者。 在某些情况下,适合应用程序从活动呼叫中删除参与者。 此操作可在参与者应答呼叫之前或之后执行。 删除活动呼叫者后,会立即从呼叫中删除这些呼叫,同时不会发出删除前或删除后通知。 删除受邀参与者后,将取消任何未完成的添加参与者请求。
Permissions
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限 。
权限类型
权限(从最低特权到最高特权)
委派(工作或学校帐户)
不支持
委派(个人 Microsoft 帐户)
不支持
Application
Calls.JoinGroupCallsasGuest.All 或 Calls.JoinGroupCalls.All
需要租户级应用程序会议配置,应用程序才能调用此 API。 租户管理员应在租户远程 PowerShell 上调用以下 cmdlet,以向应用程序授予调用此 API 的权限。 有关详细信息,请参阅 Set-CsApplicationMeetingConfiguration 。
PS C:\> Set-CsApplicationMeetingConfiguration -AllowRemoveParticipantAppIds @{Add="app_id"}
HTTP 请求
DELETE /communications/calls/{id}/participants/{id}
名称
说明
Authorization
Bearer {token}。必需。
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法返回 204 No Content 响应代码。它不在响应正文中返回任何内容。
示例
示例 1:取消活动参与者
请求
下面为请求示例。
DELETE https://graph.microsoft.com/v1.0/communications/calls/{id}/participants/{id}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
await graphClient.Communications.Calls["{call-id}"].Participants["{participant-id}"]
.Request()
.DeleteAsync();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
const options = {
authProvider,
};
const client = Client.init(options);
await client.api('/communications/calls/{id}/participants/{id}')
.version('beta')
.delete();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/communications/calls/{id}/participants/{id}"]]];
[urlRequest setHTTPMethod:@"DELETE"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
graphClient.communications().calls("{id}").participants("{id}")
.buildRequest()
.delete();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
callId := "call-id"
participantId := "participant-id"
graphClient.Communications().CallsById(&callId).ParticipantsById(&participantId).Delete()
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
Import-Module Microsoft.Graph.CloudCommunications
Remove-MgCommunicationCallParticipant -CallId $callId -ParticipantId $participantId
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
响应
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 204 No Content
示例 2:取消受邀的非活动参与者
邀请参与者加入现有呼叫
POST https://graph.microsoft.com/beta/communications/calls/{id}/participants/invite
Content-Type: application/json
Content-Length: 464
{
"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",
"identityProvider": "AAD"
}
}
}
],
"clientContext": "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var participants = new List<InvitationParticipantInfo>()
{
new InvitationParticipantInfo
{
ReplacesCallId = "a7ebfb2d-871e-419c-87af-27290b22e8db",
Identity = new IdentitySet
{
User = new Identity
{
Id = "278405a3-f568-4b3e-b684-009193463064",
AdditionalData = new Dictionary<string, object>()
{
{"identityProvider", "AAD"}
}
}
}
}
};
var clientContext = "f2fa86af-3c51-4bc2-8fc0-475452d9764f";
await graphClient.Communications.Calls["{call-id}"].Participants
.Invite(participants,clientContext)
.Request()
.PostAsync();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
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',
identityProvider: 'AAD'
}
}
}
],
clientContext: 'f2fa86af-3c51-4bc2-8fc0-475452d9764f'
};
await client.api('/communications/calls/{id}/participants/invite')
.version('beta')
.post(inviteParticipantsOperation);
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/communications/calls/{id}/participants/invite"]]];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSMutableDictionary *payloadDictionary = [[NSMutableDictionary alloc] init];
NSMutableArray *participantsList = [[NSMutableArray alloc] init];
MSGraphInvitationParticipantInfo *participants = [[MSGraphInvitationParticipantInfo alloc] init];
[participants setReplacesCallId:@"a7ebfb2d-871e-419c-87af-27290b22e8db"];
MSGraphIdentitySet *identity = [[MSGraphIdentitySet alloc] init];
MSGraphIdentity *user = [[MSGraphIdentity alloc] init];
[user setId:@"278405a3-f568-4b3e-b684-009193463064"];
[user setIdentityProvider:@"AAD"];
[identity setUser:user];
[participants setIdentity:identity];
[participantsList addObject: participants];
payloadDictionary[@"participants"] = participantsList;
NSString *clientContext = @"f2fa86af-3c51-4bc2-8fc0-475452d9764f";
payloadDictionary[@"clientContext"] = clientContext;
NSData *data = [NSJSONSerialization dataWithJSONObject:payloadDictionary options:kNilOptions error:&error];
[urlRequest setHTTPBody:data];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
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();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.New()
requestBody.SetParticipants( []InvitationParticipantInfo {
msgraphsdk.NewInvitationParticipantInfo(),
SetAdditionalData(map[string]interface{}{
"@odata.type": "#microsoft.graph.invitationParticipantInfo",
"replacesCallId": "a7ebfb2d-871e-419c-87af-27290b22e8db",
}
}
clientContext := "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
requestBody.SetClientContext(&clientContext)
callId := "call-id"
result, err := graphClient.Communications().CallsById(&callId).Participants().Invite(call-id).Post(requestBody)
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
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"
IdentityProvider = "AAD"
}
}
}
)
ClientContext = "f2fa86af-3c51-4bc2-8fc0-475452d9764f"
}
Invoke-MgInviteCommunicationCallParticipant -CallId $callId -BodyParameter $params
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
响应
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
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": "a7ebfb2d-871e-419c-87af-27290b22e8db",
"identity": {
"user": {
"id": "278405a3-f568-4b3e-b684-009193463064",
"identityProvider": "AAD",
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47"
},
"application": null,
"device": null,
"phone": null
}
}
]
}
在将参与者添加到名单之前删除受邀参与者
DELETE https://graph.microsoft.com/beta/communications/calls/{id}/participants/{id}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
await graphClient.Communications.Calls["{call-id}"].Participants["{participant-id}"]
.Request()
.DeleteAsync();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
const options = {
authProvider,
};
const client = Client.init(options);
await client.api('/communications/calls/{id}/participants/{id}')
.version('beta')
.delete();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/communications/calls/{id}/participants/{id}"]]];
[urlRequest setHTTPMethod:@"DELETE"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
graphClient.communications().calls("{id}").participants("{id}")
.buildRequest()
.delete();
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
callId := "call-id"
participantId := "participant-id"
graphClient.Communications().CallsById(&callId).ParticipantsById(&participantId).Delete()
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
Import-Module Microsoft.Graph.CloudCommunications
Remove-MgCommunicationCallParticipant -CallId $callId -ParticipantId $participantId
有关如何将 SDK 添加 到项目并 创建 authProvider 实例的 详细信息,请参阅 SDK 文档 。
响应
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 204 No Content