调用:转移
本文内容
命名空间:microsoft.graph
重要
Microsoft Graph /beta
版本下的 API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
转移活动的对等呼叫或组呼叫。
注意: 仅当受让者和转移目标都是属于同一租户的 Microsoft Teams 用户时,才支持此操作。 仅应用程序实例支持转移到 PSTN 号码。 若要详细了解转让人、受让人和转移目标,请参阅 RFC 5589 。
咨询转接是指转让人可以在转接前通知要转接电话的人, (受让人) 。 这与直接转移呼叫相反。
此 API 可用于以下国家级云部署 。
全局服务
美国政府 L4
美国政府 L5 (DOD)
由世纪互联运营的中国
✅
❌
❌
❌
权限
为此 API 选择标记为最低特权的权限。
只有在应用需要它时 ,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型 。 要了解有关这些权限的详细信息,请参阅 权限参考 。
权限类型
最低特权权限
更高特权权限
委派(工作或学校帐户)
不支持。
不支持。
委派(个人 Microsoft 帐户)
不支持。
不支持。
应用程序
Calls.Initiate.All
不可用。
HTTP 请求
POST /app/calls/{id}/transfer
POST /communications/calls/{id}/transfer
注意: /app
路径已弃用。 今后将使用 /communications
路径。
名称
说明
Authorization
持有者 {token}。 必填。 详细了解 身份验证和授权 。
Content-type
application/json. 必需。
请求正文
在请求正文中,提供具有以下参数的 JSON 对象。
响应
如果成功,此方法返回 202 Accepted
响应代码。
示例
这些示例演示传入呼叫一直流到不同类型的传输通知。
示例 1:从对等呼叫转移
请求
下面为请求示例。
POST https://graph.microsoft.com/beta/communications/calls/{id}/transfer
Content-Type: application/json
Content-Length: 430
{
"transferTarget": {
"endpointType": "default",
"identity": {
"user": {
"id": "550fae72-d251-43ec-868c-373732c2704f",
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
"displayName": "Heidi Steen"
}
},
"languageId": "languageId-value",
"region": "region-value"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Communications.Calls.Item.Transfer;
using Microsoft.Graph.Beta.Models;
var requestBody = new TransferPostRequestBody
{
TransferTarget = new InvitationParticipantInfo
{
EndpointType = EndpointType.Default,
Identity = new IdentitySet
{
User = new Identity
{
Id = "550fae72-d251-43ec-868c-373732c2704f",
DisplayName = "Heidi Steen",
AdditionalData = new Dictionary<string, object>
{
{
"tenantId" , "72f988bf-86f1-41af-91ab-2d7cd011db47"
},
},
},
},
AdditionalData = new Dictionary<string, object>
{
{
"languageId" , "languageId-value"
},
{
"region" , "region-value"
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Communications.Calls["{call-id}"].Transfer.PostAsync(requestBody);
mgc-beta communications calls transfer post --call-id {call-id} --body '{\
"transferTarget": {\
"endpointType": "default",\
"identity": {\
"user": {\
"id": "550fae72-d251-43ec-868c-373732c2704f",\
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",\
"displayName": "Heidi Steen"\
}\
},\
"languageId": "languageId-value",\
"region": "region-value"\
}\
}\
'
// 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"
graphcommunications "github.com/microsoftgraph/msgraph-beta-sdk-go/communications"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphcommunications.NewTransferPostRequestBody()
transferTarget := graphmodels.NewInvitationParticipantInfo()
endpointType := graphmodels.DEFAULT_ENDPOINTTYPE
transferTarget.SetEndpointType(&endpointType)
identity := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
id := "550fae72-d251-43ec-868c-373732c2704f"
user.SetId(&id)
displayName := "Heidi Steen"
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"tenantId" : "72f988bf-86f1-41af-91ab-2d7cd011db47",
}
user.SetAdditionalData(additionalData)
identity.SetUser(user)
transferTarget.SetIdentity(identity)
additionalData := map[string]interface{}{
"languageId" : "languageId-value",
"region" : "region-value",
}
transferTarget.SetAdditionalData(additionalData)
requestBody.SetTransferTarget(transferTarget)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Communications().Calls().ByCallId("call-id").Transfer().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.beta.communications.calls.item.transfer.TransferPostRequestBody transferPostRequestBody = new com.microsoft.graph.beta.communications.calls.item.transfer.TransferPostRequestBody();
InvitationParticipantInfo transferTarget = new InvitationParticipantInfo();
transferTarget.setEndpointType(EndpointType.Default);
IdentitySet identity = new IdentitySet();
Identity user = new Identity();
user.setId("550fae72-d251-43ec-868c-373732c2704f");
user.setDisplayName("Heidi Steen");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("tenantId", "72f988bf-86f1-41af-91ab-2d7cd011db47");
user.setAdditionalData(additionalData);
identity.setUser(user);
transferTarget.setIdentity(identity);
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
additionalData1.put("languageId", "languageId-value");
additionalData1.put("region", "region-value");
transferTarget.setAdditionalData(additionalData1);
transferPostRequestBody.setTransferTarget(transferTarget);
graphClient.communications().calls().byCallId("{call-id}").transfer().post(transferPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const transfer = {
transferTarget: {
endpointType: 'default',
identity: {
user: {
id: '550fae72-d251-43ec-868c-373732c2704f',
tenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47',
displayName: 'Heidi Steen'
}
},
languageId: 'languageId-value',
region: 'region-value'
}
};
await client.api('/communications/calls/{id}/transfer')
.version('beta')
.post(transfer);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Communications\Calls\Item\Transfer\TransferPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\InvitationParticipantInfo;
use Microsoft\Graph\Beta\Generated\Models\EndpointType;
use Microsoft\Graph\Beta\Generated\Models\IdentitySet;
use Microsoft\Graph\Beta\Generated\Models\Identity;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new TransferPostRequestBody();
$transferTarget = new InvitationParticipantInfo();
$transferTarget->setEndpointType(new EndpointType('default'));
$transferTargetIdentity = new IdentitySet();
$transferTargetIdentityUser = new Identity();
$transferTargetIdentityUser->setId('550fae72-d251-43ec-868c-373732c2704f');
$transferTargetIdentityUser->setDisplayName('Heidi Steen');
$additionalData = [
'tenantId' => '72f988bf-86f1-41af-91ab-2d7cd011db47',
];
$transferTargetIdentityUser->setAdditionalData($additionalData);
$transferTargetIdentity->setUser($transferTargetIdentityUser);
$transferTarget->setIdentity($transferTargetIdentity);
$additionalData = [
'languageId' => 'languageId-value',
'region' => 'region-value',
];
$transferTarget->setAdditionalData($additionalData);
$requestBody->setTransferTarget($transferTarget);
$graphServiceClient->communications()->calls()->byCallId('call-id')->transfer()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.CloudCommunications
$params = @{
transferTarget = @{
endpointType = "default"
identity = @{
user = @{
id = "550fae72-d251-43ec-868c-373732c2704f"
tenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"
displayName = "Heidi Steen"
}
}
languageId = "languageId-value"
region = "region-value"
}
}
Move-MgBetaCommunicationCall -CallId $callId -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.communications.calls.item.transfer.transfer_post_request_body import TransferPostRequestBody
from msgraph_beta.generated.models.invitation_participant_info import InvitationParticipantInfo
from msgraph_beta.generated.models.endpoint_type import EndpointType
from msgraph_beta.generated.models.identity_set import IdentitySet
from msgraph_beta.generated.models.identity import Identity
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = TransferPostRequestBody(
transfer_target = InvitationParticipantInfo(
endpoint_type = EndpointType.Default,
identity = IdentitySet(
user = Identity(
id = "550fae72-d251-43ec-868c-373732c2704f",
display_name = "Heidi Steen",
additional_data = {
"tenant_id" : "72f988bf-86f1-41af-91ab-2d7cd011db47",
}
),
),
additional_data = {
"language_id" : "languageId-value",
"region" : "region-value",
}
),
)
await graph_client.communications.calls.by_call_id('call-id').transfer.post(request_body)
响应
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 202 Accepted
通知 - 传输
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "updated",
"resourceUrl": "/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "transferring"
}
}
]
}
通知 - 已接受传输
注意: 接受传输可能在媒体状态音频处于非活动状态之后或之前发生。
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "updated",
"resourceUrl": "/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "transferAccepted"
}
}
]
}
通知 - 传输已完成
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "deleted",
"resourceUrl": "/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "terminated",
"resultInfo": {
"@odata.type": "#microsoft.graph.resultInfo",
"code": 0,
"subcode": 7015,
"message": "GracefulTransferCompleted"
}
}
}
]
}
通知 - 传输失败
注意: 当呼叫转移失败时,呼叫状态将为 established
。
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "updated",
"resourceUrl": "/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "established",
"resultInfo": {
"@odata.type": "#microsoft.graph.resultInfo",
"code": 500,
"subCode": 7000,
"message": "<message>"
}
}
}
]
}
示例 2:从对等呼叫进行咨询转移
请求
下面为请求示例。
POST https://graph.microsoft.com/beta/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b/transfer
Content-Type: application/json
{
"transferTarget": {
"@odata.type": "#microsoft.graph.invitationParticipantInfo",
"endpointType": "default",
"identity": {
"@odata.type": "#microsoft.graph.identitySet",
"user": {
"@odata.type": "#microsoft.graph.identity",
"id": "550fae72-d251-43ec-868c-373732c2704f",
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
"displayName": "Heidi Steen"
}
},
"languageId": "en-us",
"region": "amer",
"replacesCallId": "e5d39592-99bd-4db8-bca8-30fb894ec51d"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Communications.Calls.Item.Transfer;
using Microsoft.Graph.Beta.Models;
var requestBody = new TransferPostRequestBody
{
TransferTarget = new InvitationParticipantInfo
{
OdataType = "#microsoft.graph.invitationParticipantInfo",
EndpointType = EndpointType.Default,
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
User = new Identity
{
OdataType = "#microsoft.graph.identity",
Id = "550fae72-d251-43ec-868c-373732c2704f",
DisplayName = "Heidi Steen",
AdditionalData = new Dictionary<string, object>
{
{
"tenantId" , "72f988bf-86f1-41af-91ab-2d7cd011db47"
},
},
},
},
ReplacesCallId = "e5d39592-99bd-4db8-bca8-30fb894ec51d",
AdditionalData = new Dictionary<string, object>
{
{
"languageId" , "en-us"
},
{
"region" , "amer"
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Communications.Calls["{call-id}"].Transfer.PostAsync(requestBody);
mgc-beta communications calls transfer post --call-id {call-id} --body '{\
"transferTarget": {\
"@odata.type": "#microsoft.graph.invitationParticipantInfo",\
"endpointType": "default",\
"identity": {\
"@odata.type": "#microsoft.graph.identitySet",\
"user": {\
"@odata.type": "#microsoft.graph.identity",\
"id": "550fae72-d251-43ec-868c-373732c2704f",\
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",\
"displayName": "Heidi Steen"\
}\
},\
"languageId": "en-us",\
"region": "amer",\
"replacesCallId": "e5d39592-99bd-4db8-bca8-30fb894ec51d"\
}\
}\
'
// 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"
graphcommunications "github.com/microsoftgraph/msgraph-beta-sdk-go/communications"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphcommunications.NewTransferPostRequestBody()
transferTarget := graphmodels.NewInvitationParticipantInfo()
endpointType := graphmodels.DEFAULT_ENDPOINTTYPE
transferTarget.SetEndpointType(&endpointType)
identity := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
id := "550fae72-d251-43ec-868c-373732c2704f"
user.SetId(&id)
displayName := "Heidi Steen"
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"tenantId" : "72f988bf-86f1-41af-91ab-2d7cd011db47",
}
user.SetAdditionalData(additionalData)
identity.SetUser(user)
transferTarget.SetIdentity(identity)
replacesCallId := "e5d39592-99bd-4db8-bca8-30fb894ec51d"
transferTarget.SetReplacesCallId(&replacesCallId)
additionalData := map[string]interface{}{
"languageId" : "en-us",
"region" : "amer",
}
transferTarget.SetAdditionalData(additionalData)
requestBody.SetTransferTarget(transferTarget)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Communications().Calls().ByCallId("call-id").Transfer().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.beta.communications.calls.item.transfer.TransferPostRequestBody transferPostRequestBody = new com.microsoft.graph.beta.communications.calls.item.transfer.TransferPostRequestBody();
InvitationParticipantInfo transferTarget = new InvitationParticipantInfo();
transferTarget.setOdataType("#microsoft.graph.invitationParticipantInfo");
transferTarget.setEndpointType(EndpointType.Default);
IdentitySet identity = new IdentitySet();
identity.setOdataType("#microsoft.graph.identitySet");
Identity user = new Identity();
user.setOdataType("#microsoft.graph.identity");
user.setId("550fae72-d251-43ec-868c-373732c2704f");
user.setDisplayName("Heidi Steen");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("tenantId", "72f988bf-86f1-41af-91ab-2d7cd011db47");
user.setAdditionalData(additionalData);
identity.setUser(user);
transferTarget.setIdentity(identity);
transferTarget.setReplacesCallId("e5d39592-99bd-4db8-bca8-30fb894ec51d");
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
additionalData1.put("languageId", "en-us");
additionalData1.put("region", "amer");
transferTarget.setAdditionalData(additionalData1);
transferPostRequestBody.setTransferTarget(transferTarget);
graphClient.communications().calls().byCallId("{call-id}").transfer().post(transferPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const transfer = {
transferTarget: {
'@odata.type': '#microsoft.graph.invitationParticipantInfo',
endpointType: 'default',
identity: {
'@odata.type': '#microsoft.graph.identitySet',
user: {
'@odata.type': '#microsoft.graph.identity',
id: '550fae72-d251-43ec-868c-373732c2704f',
tenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47',
displayName: 'Heidi Steen'
}
},
languageId: 'en-us',
region: 'amer',
replacesCallId: 'e5d39592-99bd-4db8-bca8-30fb894ec51d'
}
};
await client.api('/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b/transfer')
.version('beta')
.post(transfer);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Communications\Calls\Item\Transfer\TransferPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\InvitationParticipantInfo;
use Microsoft\Graph\Beta\Generated\Models\EndpointType;
use Microsoft\Graph\Beta\Generated\Models\IdentitySet;
use Microsoft\Graph\Beta\Generated\Models\Identity;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new TransferPostRequestBody();
$transferTarget = new InvitationParticipantInfo();
$transferTarget->setOdataType('#microsoft.graph.invitationParticipantInfo');
$transferTarget->setEndpointType(new EndpointType('default'));
$transferTargetIdentity = new IdentitySet();
$transferTargetIdentity->setOdataType('#microsoft.graph.identitySet');
$transferTargetIdentityUser = new Identity();
$transferTargetIdentityUser->setOdataType('#microsoft.graph.identity');
$transferTargetIdentityUser->setId('550fae72-d251-43ec-868c-373732c2704f');
$transferTargetIdentityUser->setDisplayName('Heidi Steen');
$additionalData = [
'tenantId' => '72f988bf-86f1-41af-91ab-2d7cd011db47',
];
$transferTargetIdentityUser->setAdditionalData($additionalData);
$transferTargetIdentity->setUser($transferTargetIdentityUser);
$transferTarget->setIdentity($transferTargetIdentity);
$transferTarget->setReplacesCallId('e5d39592-99bd-4db8-bca8-30fb894ec51d');
$additionalData = [
'languageId' => 'en-us',
'region' => 'amer',
];
$transferTarget->setAdditionalData($additionalData);
$requestBody->setTransferTarget($transferTarget);
$graphServiceClient->communications()->calls()->byCallId('call-id')->transfer()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.CloudCommunications
$params = @{
transferTarget = @{
"@odata.type" = "#microsoft.graph.invitationParticipantInfo"
endpointType = "default"
identity = @{
"@odata.type" = "#microsoft.graph.identitySet"
user = @{
"@odata.type" = "#microsoft.graph.identity"
id = "550fae72-d251-43ec-868c-373732c2704f"
tenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"
displayName = "Heidi Steen"
}
}
languageId = "en-us"
region = "amer"
replacesCallId = "e5d39592-99bd-4db8-bca8-30fb894ec51d"
}
}
Move-MgBetaCommunicationCall -CallId $callId -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.communications.calls.item.transfer.transfer_post_request_body import TransferPostRequestBody
from msgraph_beta.generated.models.invitation_participant_info import InvitationParticipantInfo
from msgraph_beta.generated.models.endpoint_type import EndpointType
from msgraph_beta.generated.models.identity_set import IdentitySet
from msgraph_beta.generated.models.identity import Identity
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = TransferPostRequestBody(
transfer_target = InvitationParticipantInfo(
odata_type = "#microsoft.graph.invitationParticipantInfo",
endpoint_type = EndpointType.Default,
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
user = Identity(
odata_type = "#microsoft.graph.identity",
id = "550fae72-d251-43ec-868c-373732c2704f",
display_name = "Heidi Steen",
additional_data = {
"tenant_id" : "72f988bf-86f1-41af-91ab-2d7cd011db47",
}
),
),
replaces_call_id = "e5d39592-99bd-4db8-bca8-30fb894ec51d",
additional_data = {
"language_id" : "en-us",
"region" : "amer",
}
),
)
await graph_client.communications.calls.by_call_id('call-id').transfer.post(request_body)
响应
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 202 Accepted
通知 - 传输
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "updated",
"resourceUrl": "/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "transferring"
}
}
]
}
通知 - 已接受传输
注意: 接受传输可能在媒体状态音频处于非活动状态之后或之前发生。
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "updated",
"resourceUrl": "/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "transferAccepted"
}
}
]
}
通知 - 传输已完成
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "deleted",
"resourceUrl": "/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "terminated",
"terminationReason": "AppTransferred"
}
}
]
}
通知 - 传输失败
注意: 当呼叫转移失败时,呼叫状态将为 established
。
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "updated",
"resourceUrl": "/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "established",
"resultInfo": {
"@odata.type": "#microsoft.graph.resultInfo",
"code": 500,
"subCode": 7700,
"message": "<message>"
},
"replacesContext": "<replacesContext>"
}
}
]
}
示例 3:从对等呼叫转移到 PSTN 号码的呼叫
此调用需要分配了 PSTN 号码的应用程序实例。 有关详细信息,请参阅 为机器人分配电话号码 。
注意: 电话 ID 是 E.164 格式的电话号码。
请求
下面为请求示例。
POST https://graph.microsoft.com/beta/communications/calls/{id}/transfer
Content-Type: application/json
Content-Length: 430
{
"transferTarget": {
"endpointType": "default",
"identity": {
"phone": {
"@odata.type": "#microsoft.graph.identity",
"id": "+12345678901"
}
},
"languageId": "languageId-value",
"region": "region-value"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Communications.Calls.Item.Transfer;
using Microsoft.Graph.Beta.Models;
var requestBody = new TransferPostRequestBody
{
TransferTarget = new InvitationParticipantInfo
{
EndpointType = EndpointType.Default,
Identity = new IdentitySet
{
AdditionalData = new Dictionary<string, object>
{
{
"phone" , new Identity
{
OdataType = "#microsoft.graph.identity",
Id = "+12345678901",
}
},
},
},
AdditionalData = new Dictionary<string, object>
{
{
"languageId" , "languageId-value"
},
{
"region" , "region-value"
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Communications.Calls["{call-id}"].Transfer.PostAsync(requestBody);
mgc-beta communications calls transfer post --call-id {call-id} --body '{\
"transferTarget": {\
"endpointType": "default",\
"identity": {\
"phone": {\
"@odata.type": "#microsoft.graph.identity",\
"id": "+12345678901"\
}\
},\
"languageId": "languageId-value",\
"region": "region-value"\
}\
}\
'
// 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"
graphcommunications "github.com/microsoftgraph/msgraph-beta-sdk-go/communications"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphcommunications.NewTransferPostRequestBody()
transferTarget := graphmodels.NewInvitationParticipantInfo()
endpointType := graphmodels.DEFAULT_ENDPOINTTYPE
transferTarget.SetEndpointType(&endpointType)
identity := graphmodels.NewIdentitySet()
additionalData := map[string]interface{}{
phone := graphmodels.NewIdentity()
id := "+12345678901"
phone.SetId(&id)
identity.SetPhone(phone)
}
identity.SetAdditionalData(additionalData)
transferTarget.SetIdentity(identity)
additionalData := map[string]interface{}{
"languageId" : "languageId-value",
"region" : "region-value",
}
transferTarget.SetAdditionalData(additionalData)
requestBody.SetTransferTarget(transferTarget)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Communications().Calls().ByCallId("call-id").Transfer().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.beta.communications.calls.item.transfer.TransferPostRequestBody transferPostRequestBody = new com.microsoft.graph.beta.communications.calls.item.transfer.TransferPostRequestBody();
InvitationParticipantInfo transferTarget = new InvitationParticipantInfo();
transferTarget.setEndpointType(EndpointType.Default);
IdentitySet identity = new IdentitySet();
HashMap<String, Object> additionalData = new HashMap<String, Object>();
Identity phone = new Identity();
phone.setOdataType("#microsoft.graph.identity");
phone.setId("+12345678901");
additionalData.put("phone", phone);
identity.setAdditionalData(additionalData);
transferTarget.setIdentity(identity);
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
additionalData1.put("languageId", "languageId-value");
additionalData1.put("region", "region-value");
transferTarget.setAdditionalData(additionalData1);
transferPostRequestBody.setTransferTarget(transferTarget);
graphClient.communications().calls().byCallId("{call-id}").transfer().post(transferPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const transfer = {
transferTarget: {
endpointType: 'default',
identity: {
phone: {
'@odata.type': '#microsoft.graph.identity',
id: '+12345678901'
}
},
languageId: 'languageId-value',
region: 'region-value'
}
};
await client.api('/communications/calls/{id}/transfer')
.version('beta')
.post(transfer);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Communications\Calls\Item\Transfer\TransferPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\InvitationParticipantInfo;
use Microsoft\Graph\Beta\Generated\Models\EndpointType;
use Microsoft\Graph\Beta\Generated\Models\IdentitySet;
use Microsoft\Graph\Beta\Generated\Models\Identity;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new TransferPostRequestBody();
$transferTarget = new InvitationParticipantInfo();
$transferTarget->setEndpointType(new EndpointType('default'));
$transferTargetIdentity = new IdentitySet();
$additionalData = [
'phone' => [
'@odata.type' => '#microsoft.graph.identity',
'id' => '+12345678901',
],
];
$transferTargetIdentity->setAdditionalData($additionalData);
$transferTarget->setIdentity($transferTargetIdentity);
$additionalData = [
'languageId' => 'languageId-value',
'region' => 'region-value',
];
$transferTarget->setAdditionalData($additionalData);
$requestBody->setTransferTarget($transferTarget);
$graphServiceClient->communications()->calls()->byCallId('call-id')->transfer()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.CloudCommunications
$params = @{
transferTarget = @{
endpointType = "default"
identity = @{
phone = @{
"@odata.type" = "#microsoft.graph.identity"
id = "+12345678901"
}
}
languageId = "languageId-value"
region = "region-value"
}
}
Move-MgBetaCommunicationCall -CallId $callId -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.communications.calls.item.transfer.transfer_post_request_body import TransferPostRequestBody
from msgraph_beta.generated.models.invitation_participant_info import InvitationParticipantInfo
from msgraph_beta.generated.models.endpoint_type import EndpointType
from msgraph_beta.generated.models.identity_set import IdentitySet
from msgraph_beta.generated.models.identity import Identity
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = TransferPostRequestBody(
transfer_target = InvitationParticipantInfo(
endpoint_type = EndpointType.Default,
identity = IdentitySet(
additional_data = {
"phone" : {
"@odata_type" : "#microsoft.graph.identity",
"id" : "+12345678901",
},
}
),
additional_data = {
"language_id" : "languageId-value",
"region" : "region-value",
}
),
)
await graph_client.communications.calls.by_call_id('call-id').transfer.post(request_body)
响应
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 202 Accepted
通知 - 传输
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "updated",
"resourceUrl": "/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "transferring"
}
}
]
}
通知 - 已接受传输
注意: 接受传输可能在媒体状态音频处于非活动状态之后或之前发生。
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "updated",
"resourceUrl": "/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "transferAccepted"
}
}
]
}
通知 - 传输已完成
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "deleted",
"resourceUrl": "/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "terminated",
"resultInfo": {
"@odata.type": "#microsoft.graph.resultInfo",
"code": 0,
"subcode": 7015,
"message": "GracefulTransferCompleted"
}
}
}
]
}
通知 - 传输失败
注意: 当呼叫转移失败时,呼叫状态将为 established
。
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "updated",
"resourceUrl": "/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "established",
"resultInfo": {
"@odata.type": "#microsoft.graph.resultInfo",
"code": 500,
"subCode": 7000,
"message": "<message>"
}
}
}
]
}
示例 4:从对等呼叫到 PSTN 号码的咨询转移
此调用需要分配了 PSTN 号码的应用程序实例。 有关详细信息,请参阅 为机器人分配电话号码 。
注意: 电话 ID 是 E.164 格式的电话号码。
请求
下面为请求示例。
POST https://graph.microsoft.com/beta/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b/transfer
Content-Type: application/json
{
"transferTarget": {
"@odata.type": "#microsoft.graph.invitationParticipantInfo",
"endpointType": "default",
"identity": {
"@odata.type": "#microsoft.graph.identitySet",
"phone": {
"@odata.type": "#microsoft.graph.identity",
"id": "+12345678901"
}
},
"languageId": "en-us",
"region": "amer",
"replacesCallId": "e5d39592-99bd-4db8-bca8-30fb894ec51d"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Communications.Calls.Item.Transfer;
using Microsoft.Graph.Beta.Models;
var requestBody = new TransferPostRequestBody
{
TransferTarget = new InvitationParticipantInfo
{
OdataType = "#microsoft.graph.invitationParticipantInfo",
EndpointType = EndpointType.Default,
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
AdditionalData = new Dictionary<string, object>
{
{
"phone" , new Identity
{
OdataType = "#microsoft.graph.identity",
Id = "+12345678901",
}
},
},
},
ReplacesCallId = "e5d39592-99bd-4db8-bca8-30fb894ec51d",
AdditionalData = new Dictionary<string, object>
{
{
"languageId" , "en-us"
},
{
"region" , "amer"
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Communications.Calls["{call-id}"].Transfer.PostAsync(requestBody);
mgc-beta communications calls transfer post --call-id {call-id} --body '{\
"transferTarget": {\
"@odata.type": "#microsoft.graph.invitationParticipantInfo",\
"endpointType": "default",\
"identity": {\
"@odata.type": "#microsoft.graph.identitySet",\
"phone": {\
"@odata.type": "#microsoft.graph.identity",\
"id": "+12345678901"\
}\
},\
"languageId": "en-us",\
"region": "amer",\
"replacesCallId": "e5d39592-99bd-4db8-bca8-30fb894ec51d"\
}\
}\
'
// 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"
graphcommunications "github.com/microsoftgraph/msgraph-beta-sdk-go/communications"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphcommunications.NewTransferPostRequestBody()
transferTarget := graphmodels.NewInvitationParticipantInfo()
endpointType := graphmodels.DEFAULT_ENDPOINTTYPE
transferTarget.SetEndpointType(&endpointType)
identity := graphmodels.NewIdentitySet()
additionalData := map[string]interface{}{
phone := graphmodels.NewIdentity()
id := "+12345678901"
phone.SetId(&id)
identity.SetPhone(phone)
}
identity.SetAdditionalData(additionalData)
transferTarget.SetIdentity(identity)
replacesCallId := "e5d39592-99bd-4db8-bca8-30fb894ec51d"
transferTarget.SetReplacesCallId(&replacesCallId)
additionalData := map[string]interface{}{
"languageId" : "en-us",
"region" : "amer",
}
transferTarget.SetAdditionalData(additionalData)
requestBody.SetTransferTarget(transferTarget)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Communications().Calls().ByCallId("call-id").Transfer().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.beta.communications.calls.item.transfer.TransferPostRequestBody transferPostRequestBody = new com.microsoft.graph.beta.communications.calls.item.transfer.TransferPostRequestBody();
InvitationParticipantInfo transferTarget = new InvitationParticipantInfo();
transferTarget.setOdataType("#microsoft.graph.invitationParticipantInfo");
transferTarget.setEndpointType(EndpointType.Default);
IdentitySet identity = new IdentitySet();
identity.setOdataType("#microsoft.graph.identitySet");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
Identity phone = new Identity();
phone.setOdataType("#microsoft.graph.identity");
phone.setId("+12345678901");
additionalData.put("phone", phone);
identity.setAdditionalData(additionalData);
transferTarget.setIdentity(identity);
transferTarget.setReplacesCallId("e5d39592-99bd-4db8-bca8-30fb894ec51d");
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
additionalData1.put("languageId", "en-us");
additionalData1.put("region", "amer");
transferTarget.setAdditionalData(additionalData1);
transferPostRequestBody.setTransferTarget(transferTarget);
graphClient.communications().calls().byCallId("{call-id}").transfer().post(transferPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const transfer = {
transferTarget: {
'@odata.type': '#microsoft.graph.invitationParticipantInfo',
endpointType: 'default',
identity: {
'@odata.type': '#microsoft.graph.identitySet',
phone: {
'@odata.type': '#microsoft.graph.identity',
id: '+12345678901'
}
},
languageId: 'en-us',
region: 'amer',
replacesCallId: 'e5d39592-99bd-4db8-bca8-30fb894ec51d'
}
};
await client.api('/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b/transfer')
.version('beta')
.post(transfer);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Communications\Calls\Item\Transfer\TransferPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\InvitationParticipantInfo;
use Microsoft\Graph\Beta\Generated\Models\EndpointType;
use Microsoft\Graph\Beta\Generated\Models\IdentitySet;
use Microsoft\Graph\Beta\Generated\Models\Identity;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new TransferPostRequestBody();
$transferTarget = new InvitationParticipantInfo();
$transferTarget->setOdataType('#microsoft.graph.invitationParticipantInfo');
$transferTarget->setEndpointType(new EndpointType('default'));
$transferTargetIdentity = new IdentitySet();
$transferTargetIdentity->setOdataType('#microsoft.graph.identitySet');
$additionalData = [
'phone' => [
'@odata.type' => '#microsoft.graph.identity',
'id' => '+12345678901',
],
];
$transferTargetIdentity->setAdditionalData($additionalData);
$transferTarget->setIdentity($transferTargetIdentity);
$transferTarget->setReplacesCallId('e5d39592-99bd-4db8-bca8-30fb894ec51d');
$additionalData = [
'languageId' => 'en-us',
'region' => 'amer',
];
$transferTarget->setAdditionalData($additionalData);
$requestBody->setTransferTarget($transferTarget);
$graphServiceClient->communications()->calls()->byCallId('call-id')->transfer()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.CloudCommunications
$params = @{
transferTarget = @{
"@odata.type" = "#microsoft.graph.invitationParticipantInfo"
endpointType = "default"
identity = @{
"@odata.type" = "#microsoft.graph.identitySet"
phone = @{
"@odata.type" = "#microsoft.graph.identity"
id = "+12345678901"
}
}
languageId = "en-us"
region = "amer"
replacesCallId = "e5d39592-99bd-4db8-bca8-30fb894ec51d"
}
}
Move-MgBetaCommunicationCall -CallId $callId -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.communications.calls.item.transfer.transfer_post_request_body import TransferPostRequestBody
from msgraph_beta.generated.models.invitation_participant_info import InvitationParticipantInfo
from msgraph_beta.generated.models.endpoint_type import EndpointType
from msgraph_beta.generated.models.identity_set import IdentitySet
from msgraph_beta.generated.models.identity import Identity
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = TransferPostRequestBody(
transfer_target = InvitationParticipantInfo(
odata_type = "#microsoft.graph.invitationParticipantInfo",
endpoint_type = EndpointType.Default,
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
additional_data = {
"phone" : {
"@odata_type" : "#microsoft.graph.identity",
"id" : "+12345678901",
},
}
),
replaces_call_id = "e5d39592-99bd-4db8-bca8-30fb894ec51d",
additional_data = {
"language_id" : "en-us",
"region" : "amer",
}
),
)
await graph_client.communications.calls.by_call_id('call-id').transfer.post(request_body)
响应
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 202 Accepted
通知 - 传输
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "updated",
"resourceUrl": "/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "transferring"
}
}
]
}
通知 - 已接受传输
注意: 接受传输可能在媒体状态音频处于非活动状态之后或之前发生。
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "updated",
"resourceUrl": "/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "transferAccepted"
}
}
]
}
通知 - 传输已完成
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "deleted",
"resourceUrl": "/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "terminated",
"terminationReason": "AppTransferred"
}
}
]
}
通知 - 传输失败
注意: 当呼叫转移失败时,呼叫状态将为 established
。
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "updated",
"resourceUrl": "/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "established",
"resultInfo": {
"@odata.type": "#microsoft.graph.resultInfo",
"code": 500,
"subCode": 7700,
"message": "<message>"
}
}
}
]
}
示例 5:从组呼叫转接呼叫
注意: 若要从组调用转接,需要转接方参数。 所有其他参数与从对等调用传输的参数相同。 从组呼叫进行咨询转接或从组呼叫转移到 PSTN 类似于示例 1-4,并指定了转接方参数。
请求
下面为请求示例。
POST https://graph.microsoft.com/beta/communications/calls/{id}/transfer
Content-Type: application/json
Content-Length: 430
{
"transferTarget": {
"endpointType": "default",
"identity": {
"user": {
"id": "550fae72-d251-43ec-868c-373732c2704f",
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
"displayName": "Heidi Steen"
}
},
},
"transferee": {
"identity": {
"user": {
"id": "751f6800-3180-414d-bd94-333364659951",
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47"
}
},
"participantId": "909c6581-5130-43e9-88f3-fcb3582cde37"
},
"languageId": "languageId-value",
"region": "region-value"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Communications.Calls.Item.Transfer;
using Microsoft.Graph.Beta.Models;
var requestBody = new TransferPostRequestBody
{
TransferTarget = new InvitationParticipantInfo
{
EndpointType = EndpointType.Default,
Identity = new IdentitySet
{
User = new Identity
{
Id = "550fae72-d251-43ec-868c-373732c2704f",
DisplayName = "Heidi Steen",
AdditionalData = new Dictionary<string, object>
{
{
"tenantId" , "72f988bf-86f1-41af-91ab-2d7cd011db47"
},
},
},
},
},
Transferee = new ParticipantInfo
{
Identity = new IdentitySet
{
User = new Identity
{
Id = "751f6800-3180-414d-bd94-333364659951",
AdditionalData = new Dictionary<string, object>
{
{
"tenantId" , "72f988bf-86f1-41af-91ab-2d7cd011db47"
},
},
},
},
ParticipantId = "909c6581-5130-43e9-88f3-fcb3582cde37",
},
AdditionalData = new Dictionary<string, object>
{
{
"languageId" , "languageId-value"
},
{
"region" , "region-value"
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Communications.Calls["{call-id}"].Transfer.PostAsync(requestBody);
mgc-beta communications calls transfer post --call-id {call-id} --body '{\
"transferTarget": {\
"endpointType": "default",\
"identity": {\
"user": {\
"id": "550fae72-d251-43ec-868c-373732c2704f",\
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",\
"displayName": "Heidi Steen"\
}\
},\
},\
"transferee": {\
"identity": {\
"user": {\
"id": "751f6800-3180-414d-bd94-333364659951",\
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47"\
}\
},\
"participantId": "909c6581-5130-43e9-88f3-fcb3582cde37"\
},\
"languageId": "languageId-value",\
"region": "region-value"\
}\
'
// 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"
graphcommunications "github.com/microsoftgraph/msgraph-beta-sdk-go/communications"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphcommunications.NewTransferPostRequestBody()
transferTarget := graphmodels.NewInvitationParticipantInfo()
endpointType := graphmodels.DEFAULT_ENDPOINTTYPE
transferTarget.SetEndpointType(&endpointType)
identity := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
id := "550fae72-d251-43ec-868c-373732c2704f"
user.SetId(&id)
displayName := "Heidi Steen"
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"tenantId" : "72f988bf-86f1-41af-91ab-2d7cd011db47",
}
user.SetAdditionalData(additionalData)
identity.SetUser(user)
transferTarget.SetIdentity(identity)
requestBody.SetTransferTarget(transferTarget)
transferee := graphmodels.NewParticipantInfo()
identity := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
id := "751f6800-3180-414d-bd94-333364659951"
user.SetId(&id)
additionalData := map[string]interface{}{
"tenantId" : "72f988bf-86f1-41af-91ab-2d7cd011db47",
}
user.SetAdditionalData(additionalData)
identity.SetUser(user)
transferee.SetIdentity(identity)
participantId := "909c6581-5130-43e9-88f3-fcb3582cde37"
transferee.SetParticipantId(&participantId)
requestBody.SetTransferee(transferee)
additionalData := map[string]interface{}{
"languageId" : "languageId-value",
"region" : "region-value",
}
requestBody.SetAdditionalData(additionalData)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Communications().Calls().ByCallId("call-id").Transfer().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.beta.communications.calls.item.transfer.TransferPostRequestBody transferPostRequestBody = new com.microsoft.graph.beta.communications.calls.item.transfer.TransferPostRequestBody();
InvitationParticipantInfo transferTarget = new InvitationParticipantInfo();
transferTarget.setEndpointType(EndpointType.Default);
IdentitySet identity = new IdentitySet();
Identity user = new Identity();
user.setId("550fae72-d251-43ec-868c-373732c2704f");
user.setDisplayName("Heidi Steen");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("tenantId", "72f988bf-86f1-41af-91ab-2d7cd011db47");
user.setAdditionalData(additionalData);
identity.setUser(user);
transferTarget.setIdentity(identity);
transferPostRequestBody.setTransferTarget(transferTarget);
ParticipantInfo transferee = new ParticipantInfo();
IdentitySet identity1 = new IdentitySet();
Identity user1 = new Identity();
user1.setId("751f6800-3180-414d-bd94-333364659951");
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
additionalData1.put("tenantId", "72f988bf-86f1-41af-91ab-2d7cd011db47");
user1.setAdditionalData(additionalData1);
identity1.setUser(user1);
transferee.setIdentity(identity1);
transferee.setParticipantId("909c6581-5130-43e9-88f3-fcb3582cde37");
transferPostRequestBody.setTransferee(transferee);
HashMap<String, Object> additionalData2 = new HashMap<String, Object>();
additionalData2.put("languageId", "languageId-value");
additionalData2.put("region", "region-value");
transferPostRequestBody.setAdditionalData(additionalData2);
graphClient.communications().calls().byCallId("{call-id}").transfer().post(transferPostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const transfer = {
transferTarget: {
endpointType: 'default',
identity: {
user: {
id: '550fae72-d251-43ec-868c-373732c2704f',
tenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47',
displayName: 'Heidi Steen'
}
},
},
transferee: {
identity: {
user: {
id: '751f6800-3180-414d-bd94-333364659951',
tenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47'
}
},
participantId: '909c6581-5130-43e9-88f3-fcb3582cde37'
},
languageId: 'languageId-value',
region: 'region-value'
};
await client.api('/communications/calls/{id}/transfer')
.version('beta')
.post(transfer);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Communications\Calls\Item\Transfer\TransferPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\InvitationParticipantInfo;
use Microsoft\Graph\Beta\Generated\Models\EndpointType;
use Microsoft\Graph\Beta\Generated\Models\IdentitySet;
use Microsoft\Graph\Beta\Generated\Models\Identity;
use Microsoft\Graph\Beta\Generated\Models\ParticipantInfo;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new TransferPostRequestBody();
$transferTarget = new InvitationParticipantInfo();
$transferTarget->setEndpointType(new EndpointType('default'));
$transferTargetIdentity = new IdentitySet();
$transferTargetIdentityUser = new Identity();
$transferTargetIdentityUser->setId('550fae72-d251-43ec-868c-373732c2704f');
$transferTargetIdentityUser->setDisplayName('Heidi Steen');
$additionalData = [
'tenantId' => '72f988bf-86f1-41af-91ab-2d7cd011db47',
];
$transferTargetIdentityUser->setAdditionalData($additionalData);
$transferTargetIdentity->setUser($transferTargetIdentityUser);
$transferTarget->setIdentity($transferTargetIdentity);
$requestBody->setTransferTarget($transferTarget);
$transferee = new ParticipantInfo();
$transfereeIdentity = new IdentitySet();
$transfereeIdentityUser = new Identity();
$transfereeIdentityUser->setId('751f6800-3180-414d-bd94-333364659951');
$additionalData = [
'tenantId' => '72f988bf-86f1-41af-91ab-2d7cd011db47',
];
$transfereeIdentityUser->setAdditionalData($additionalData);
$transfereeIdentity->setUser($transfereeIdentityUser);
$transferee->setIdentity($transfereeIdentity);
$transferee->setParticipantId('909c6581-5130-43e9-88f3-fcb3582cde37');
$requestBody->setTransferee($transferee);
$additionalData = [
'languageId' => 'languageId-value',
'region' => 'region-value',
];
$requestBody->setAdditionalData($additionalData);
$graphServiceClient->communications()->calls()->byCallId('call-id')->transfer()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.CloudCommunications
$params = @{
transferTarget = @{
endpointType = "default"
identity = @{
user = @{
id = "550fae72-d251-43ec-868c-373732c2704f"
tenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"
displayName = "Heidi Steen"
}
}
}
transferee = @{
identity = @{
user = @{
id = "751f6800-3180-414d-bd94-333364659951"
tenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"
}
}
participantId = "909c6581-5130-43e9-88f3-fcb3582cde37"
}
languageId = "languageId-value"
region = "region-value"
}
Move-MgBetaCommunicationCall -CallId $callId -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.communications.calls.item.transfer.transfer_post_request_body import TransferPostRequestBody
from msgraph_beta.generated.models.invitation_participant_info import InvitationParticipantInfo
from msgraph_beta.generated.models.endpoint_type import EndpointType
from msgraph_beta.generated.models.identity_set import IdentitySet
from msgraph_beta.generated.models.identity import Identity
from msgraph_beta.generated.models.participant_info import ParticipantInfo
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = TransferPostRequestBody(
transfer_target = InvitationParticipantInfo(
endpoint_type = EndpointType.Default,
identity = IdentitySet(
user = Identity(
id = "550fae72-d251-43ec-868c-373732c2704f",
display_name = "Heidi Steen",
additional_data = {
"tenant_id" : "72f988bf-86f1-41af-91ab-2d7cd011db47",
}
),
),
),
transferee = ParticipantInfo(
identity = IdentitySet(
user = Identity(
id = "751f6800-3180-414d-bd94-333364659951",
additional_data = {
"tenant_id" : "72f988bf-86f1-41af-91ab-2d7cd011db47",
}
),
),
participant_id = "909c6581-5130-43e9-88f3-fcb3582cde37",
),
additional_data = {
"language_id" : "languageId-value",
"region" : "region-value",
}
)
await graph_client.communications.calls.by_call_id('call-id').transfer.post(request_body)
响应
HTTP/1.1 202 Accepted
通知 - 传输
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "updated",
"resourceUrl": "/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "transferring"
}
}
]
}
通知 - 已接受传输
注意: 接受传输可能在媒体状态音频处于非活动状态之后或之前发生。
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "updated",
"resourceUrl": "/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "transferAccepted"
}
}
]
}
通知 - 传输已完成
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "deleted",
"resourceUrl": "/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "terminated",
"resultInfo": {
"@odata.type": "#microsoft.graph.resultInfo",
"code": 0,
"subcode": 7015,
"message": "GracefulTransferCompleted"
}
}
}
]
}
通知 - 传输失败
注意: 当呼叫转移失败时,呼叫状态将为 established
。
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsNotification",
"changeType": "updated",
"resourceUrl": "/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b",
"resourceData": {
"@odata.type": "#microsoft.graph.call",
"state": "established",
"resultInfo": {
"@odata.type": "#microsoft.graph.resultInfo",
"code": 500,
"subCode": 7000,
"message": "<message>"
}
}
}
]
}