call: transfer
[アーティクル]
10/02/2023
14 人の共同作成者
フィードバック
この記事の内容
名前空間: microsoft.graph
アクティブなピア ツー ピア呼び出しまたはグループ呼び出しを転送します。
メモ: これは、譲渡先と譲渡先の両方が同じテナントに属する Microsoft Teams ユーザーである場合にのみサポートされます。 PSTN 番号への転送は、アプリケーション インスタンスでのみサポートされます。 転送元、譲渡先、転送先の詳細については、 RFC 5589 を参照してください。
コンサルティング転送とは、転送が行われる前に、転送元が呼び出しを転送する相手 (転送先) に通知できることを意味します。 これは、呼び出しを直接転送するのとは対照的です。
この API は、次の国内クラウド展開 で使用できます。
グローバル サービス
米国政府機関 L4
米国政府機関 L5 (DOD)
21Vianet が運営する中国
✅
✅
✅
❌
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。 アプリで必要な場合にのみ 、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「 アクセス許可の種類 」を参照してください。 これらのアクセス許可の詳細については、 アクセス許可のリファレンスを参照してください 。
アクセス許可の種類
最小特権アクセス許可
特権の高いアクセス許可
委任 (職場または学校のアカウント)
サポートされていません。
サポートされていません。
委任 (個人用 Microsoft アカウント)
サポートされていません。
サポートされていません。
アプリケーション
Calls.Initiate.All
注意事項なし。
HTTP 要求
POST /communications/calls/{id}/transfer
名前
説明
Authorization
ベアラー {token}。 必須です。 認証と承認 の詳細については、こちらをご覧ください。
Content-type
application/json. 必須です。
要求本文
要求本文で、次のパラメーターを含む JSON オブジェクトを指定します。
応答
成功した場合、このメソッドは 202 Accepted
応答コードを返します。
例
これらの例では、さまざまな種類の転送通知への着信呼び出しのフローを示します。
例 1: ピアツーピア呼び出しからの通話転送
要求
次の例は要求を示しています。
POST https://graph.microsoft.com/v1.0/communications/calls/{id}/transfer
Content-Type: application/json
Content-Length: 430
{
"transferTarget": {
"endpointType": "default",
"identity": {
"user": {
"id": "550fae72-d251-43ec-868c-373732c2704f",
"displayName": "Heidi Steen"
}
}
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Communications.Calls.Item.Transfer;
using Microsoft.Graph.Models;
var requestBody = new TransferPostRequestBody
{
TransferTarget = new InvitationParticipantInfo
{
Identity = new IdentitySet
{
User = new Identity
{
Id = "550fae72-d251-43ec-868c-373732c2704f",
DisplayName = "Heidi Steen",
},
},
AdditionalData = new Dictionary<string, object>
{
{
"endpointType" , "default"
},
},
},
};
// 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);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc communications calls transfer post --call-id {call-id} --body '{\
"transferTarget": {\
"endpointType": "default",\
"identity": {\
"user": {\
"id": "550fae72-d251-43ec-868c-373732c2704f",\
"displayName": "Heidi Steen"\
}\
}\
}\
}\
'
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
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.NewTransferPostRequestBody()
transferTarget := graphmodels.NewInvitationParticipantInfo()
identity := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
id := "550fae72-d251-43ec-868c-373732c2704f"
user.SetId(&id)
displayName := "Heidi Steen"
user.SetDisplayName(&displayName)
identity.SetUser(user)
transferTarget.SetIdentity(identity)
additionalData := map[string]interface{}{
"endpointType" : "default",
}
transferTarget.SetAdditionalData(additionalData)
requestBody.SetTransferTarget(transferTarget)
graphClient.Communications().Calls().ByCallId("call-id").Transfer().Post(context.Background(), requestBody, nil)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.communications.calls.item.transfer.TransferPostRequestBody transferPostRequestBody = new com.microsoft.graph.communications.calls.item.transfer.TransferPostRequestBody();
InvitationParticipantInfo transferTarget = new InvitationParticipantInfo();
IdentitySet identity = new IdentitySet();
Identity user = new Identity();
user.setId("550fae72-d251-43ec-868c-373732c2704f");
user.setDisplayName("Heidi Steen");
identity.setUser(user);
transferTarget.setIdentity(identity);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("endpointType", "default");
transferTarget.setAdditionalData(additionalData);
transferPostRequestBody.setTransferTarget(transferTarget);
graphClient.communications().calls().byCallId("{call-id}").transfer().post(transferPostRequestBody);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const transfer = {
transferTarget: {
endpointType: 'default',
identity: {
user: {
id: '550fae72-d251-43ec-868c-373732c2704f',
displayName: 'Heidi Steen'
}
}
}
};
await client.api('/communications/calls/{id}/transfer')
.post(transfer);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\TransferPostRequestBody;
use Microsoft\Graph\Generated\Models\InvitationParticipantInfo;
use Microsoft\Graph\Generated\Models\IdentitySet;
use Microsoft\Graph\Generated\Models\Identity;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new TransferPostRequestBody();
$transferTarget = new InvitationParticipantInfo();
$transferTargetIdentity = new IdentitySet();
$transferTargetIdentityUser = new Identity();
$transferTargetIdentityUser->setId('550fae72-d251-43ec-868c-373732c2704f');
$transferTargetIdentityUser->setDisplayName('Heidi Steen');
$transferTargetIdentity->setUser($transferTargetIdentityUser);
$transferTarget->setIdentity($transferTargetIdentity);
$additionalData = [
'endpointType' => 'default',
];
$transferTarget->setAdditionalData($additionalData);
$requestBody->setTransferTarget($transferTarget);
$graphServiceClient->communications()->calls()->byCallId('call-id')->transfer()->post($requestBody)->wait();
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
Import-Module Microsoft.Graph.CloudCommunications
$params = @{
transferTarget = @{
endpointType = "default"
identity = @{
user = @{
id = "550fae72-d251-43ec-868c-373732c2704f"
displayName = "Heidi Steen"
}
}
}
}
Move-MgCommunicationCall -CallId $callId -BodyParameter $params
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
from msgraph import GraphServiceClient
from msgraph.generated.models.transfer_post_request_body import TransferPostRequestBody
from msgraph.generated.models.invitation_participant_info import InvitationParticipantInfo
from msgraph.generated.models.identity_set import IdentitySet
from msgraph.generated.models.identity import Identity
graph_client = GraphServiceClient(credentials, scopes)
request_body = TransferPostRequestBody(
transfer_target = InvitationParticipantInfo(
identity = IdentitySet(
user = Identity(
id = "550fae72-d251-43ec-868c-373732c2704f",
display_name = "Heidi Steen",
),
),
additional_data = {
"endpoint_type" : "default",
}
),
)
await graph_client.communications.calls.by_call_id('call-id').transfer.post(request_body)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
応答
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
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/v1.0/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",
"displayName": "Heidi Steen"
}
},
"replacesCallId": "e5d39592-99bd-4db8-bca8-30fb894ec51d"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Communications.Calls.Item.Transfer;
using Microsoft.Graph.Models;
var requestBody = new TransferPostRequestBody
{
TransferTarget = new InvitationParticipantInfo
{
OdataType = "#microsoft.graph.invitationParticipantInfo",
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
User = new Identity
{
OdataType = "#microsoft.graph.identity",
Id = "550fae72-d251-43ec-868c-373732c2704f",
DisplayName = "Heidi Steen",
},
},
ReplacesCallId = "e5d39592-99bd-4db8-bca8-30fb894ec51d",
AdditionalData = new Dictionary<string, object>
{
{
"endpointType" , "default"
},
},
},
};
// 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);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc 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",\
"displayName": "Heidi Steen"\
}\
},\
"replacesCallId": "e5d39592-99bd-4db8-bca8-30fb894ec51d"\
}\
}\
'
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
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.NewTransferPostRequestBody()
transferTarget := graphmodels.NewInvitationParticipantInfo()
identity := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
id := "550fae72-d251-43ec-868c-373732c2704f"
user.SetId(&id)
displayName := "Heidi Steen"
user.SetDisplayName(&displayName)
identity.SetUser(user)
transferTarget.SetIdentity(identity)
replacesCallId := "e5d39592-99bd-4db8-bca8-30fb894ec51d"
transferTarget.SetReplacesCallId(&replacesCallId)
additionalData := map[string]interface{}{
"endpointType" : "default",
}
transferTarget.SetAdditionalData(additionalData)
requestBody.SetTransferTarget(transferTarget)
graphClient.Communications().Calls().ByCallId("call-id").Transfer().Post(context.Background(), requestBody, nil)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.communications.calls.item.transfer.TransferPostRequestBody transferPostRequestBody = new com.microsoft.graph.communications.calls.item.transfer.TransferPostRequestBody();
InvitationParticipantInfo transferTarget = new InvitationParticipantInfo();
transferTarget.setOdataType("#microsoft.graph.invitationParticipantInfo");
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");
identity.setUser(user);
transferTarget.setIdentity(identity);
transferTarget.setReplacesCallId("e5d39592-99bd-4db8-bca8-30fb894ec51d");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("endpointType", "default");
transferTarget.setAdditionalData(additionalData);
transferPostRequestBody.setTransferTarget(transferTarget);
graphClient.communications().calls().byCallId("{call-id}").transfer().post(transferPostRequestBody);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
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',
displayName: 'Heidi Steen'
}
},
replacesCallId: 'e5d39592-99bd-4db8-bca8-30fb894ec51d'
}
};
await client.api('/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b/transfer')
.post(transfer);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\TransferPostRequestBody;
use Microsoft\Graph\Generated\Models\InvitationParticipantInfo;
use Microsoft\Graph\Generated\Models\IdentitySet;
use Microsoft\Graph\Generated\Models\Identity;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new TransferPostRequestBody();
$transferTarget = new InvitationParticipantInfo();
$transferTarget->setOdataType('#microsoft.graph.invitationParticipantInfo');
$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');
$transferTargetIdentity->setUser($transferTargetIdentityUser);
$transferTarget->setIdentity($transferTargetIdentity);
$transferTarget->setReplacesCallId('e5d39592-99bd-4db8-bca8-30fb894ec51d');
$additionalData = [
'endpointType' => 'default',
];
$transferTarget->setAdditionalData($additionalData);
$requestBody->setTransferTarget($transferTarget);
$graphServiceClient->communications()->calls()->byCallId('call-id')->transfer()->post($requestBody)->wait();
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
Import-Module Microsoft.Graph.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"
displayName = "Heidi Steen"
}
}
replacesCallId = "e5d39592-99bd-4db8-bca8-30fb894ec51d"
}
}
Move-MgCommunicationCall -CallId $callId -BodyParameter $params
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
from msgraph import GraphServiceClient
from msgraph.generated.models.transfer_post_request_body import TransferPostRequestBody
from msgraph.generated.models.invitation_participant_info import InvitationParticipantInfo
from msgraph.generated.models.identity_set import IdentitySet
from msgraph.generated.models.identity import Identity
graph_client = GraphServiceClient(credentials, scopes)
request_body = TransferPostRequestBody(
transfer_target = InvitationParticipantInfo(
odata_type = "#microsoft.graph.invitationParticipantInfo",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
user = Identity(
odata_type = "#microsoft.graph.identity",
id = "550fae72-d251-43ec-868c-373732c2704f",
display_name = "Heidi Steen",
),
),
replaces_call_id = "e5d39592-99bd-4db8-bca8-30fb894ec51d",
additional_data = {
"endpoint_type" : "default",
}
),
)
await graph_client.communications.calls.by_call_id('call-id').transfer.post(request_body)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
応答
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
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/v1.0/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"
},
"clientContext": "9e90d1c1-f61e-43e7-9f75-d420159aae08"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Communications.Calls.Item.Transfer;
using Microsoft.Graph.Models;
var requestBody = new TransferPostRequestBody
{
TransferTarget = new InvitationParticipantInfo
{
Identity = new IdentitySet
{
AdditionalData = new Dictionary<string, object>
{
{
"phone" , new Identity
{
OdataType = "#microsoft.graph.identity",
Id = "+12345678901",
}
},
},
},
AdditionalData = new Dictionary<string, object>
{
{
"endpointType" , "default"
},
{
"languageId" , "languageId-value"
},
{
"region" , "region-value"
},
},
},
AdditionalData = new Dictionary<string, object>
{
{
"clientContext" , "9e90d1c1-f61e-43e7-9f75-d420159aae08"
},
},
};
// 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);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc 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"\
},\
"clientContext": "9e90d1c1-f61e-43e7-9f75-d420159aae08"\
}\
'
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
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.NewTransferPostRequestBody()
transferTarget := graphmodels.NewInvitationParticipantInfo()
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{}{
"endpointType" : "default",
"languageId" : "languageId-value",
"region" : "region-value",
}
transferTarget.SetAdditionalData(additionalData)
requestBody.SetTransferTarget(transferTarget)
additionalData := map[string]interface{}{
"clientContext" : "9e90d1c1-f61e-43e7-9f75-d420159aae08",
}
requestBody.SetAdditionalData(additionalData)
graphClient.Communications().Calls().ByCallId("call-id").Transfer().Post(context.Background(), requestBody, nil)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.communications.calls.item.transfer.TransferPostRequestBody transferPostRequestBody = new com.microsoft.graph.communications.calls.item.transfer.TransferPostRequestBody();
InvitationParticipantInfo transferTarget = new InvitationParticipantInfo();
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("endpointType", "default");
additionalData1.put("languageId", "languageId-value");
additionalData1.put("region", "region-value");
transferTarget.setAdditionalData(additionalData1);
transferPostRequestBody.setTransferTarget(transferTarget);
HashMap<String, Object> additionalData2 = new HashMap<String, Object>();
additionalData2.put("clientContext", "9e90d1c1-f61e-43e7-9f75-d420159aae08");
transferPostRequestBody.setAdditionalData(additionalData2);
graphClient.communications().calls().byCallId("{call-id}").transfer().post(transferPostRequestBody);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
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'
},
clientContext: '9e90d1c1-f61e-43e7-9f75-d420159aae08'
};
await client.api('/communications/calls/{id}/transfer')
.post(transfer);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\TransferPostRequestBody;
use Microsoft\Graph\Generated\Models\InvitationParticipantInfo;
use Microsoft\Graph\Generated\Models\IdentitySet;
use Microsoft\Graph\Generated\Models\Identity;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new TransferPostRequestBody();
$transferTarget = new InvitationParticipantInfo();
$transferTargetIdentity = new IdentitySet();
$additionalData = [
'phone' => [
'@odata.type' => '#microsoft.graph.identity',
'id' => '+12345678901',
],
];
$transferTargetIdentity->setAdditionalData($additionalData);
$transferTarget->setIdentity($transferTargetIdentity);
$additionalData = [
'endpointType' => 'default',
'languageId' => 'languageId-value',
'region' => 'region-value',
];
$transferTarget->setAdditionalData($additionalData);
$requestBody->setTransferTarget($transferTarget);
$additionalData = [
'clientContext' => '9e90d1c1-f61e-43e7-9f75-d420159aae08',
];
$requestBody->setAdditionalData($additionalData);
$graphServiceClient->communications()->calls()->byCallId('call-id')->transfer()->post($requestBody)->wait();
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
Import-Module Microsoft.Graph.CloudCommunications
$params = @{
transferTarget = @{
endpointType = "default"
identity = @{
phone = @{
"@odata.type" = "#microsoft.graph.identity"
id = "+12345678901"
}
}
languageId = "languageId-value"
region = "region-value"
}
clientContext = "9e90d1c1-f61e-43e7-9f75-d420159aae08"
}
Move-MgCommunicationCall -CallId $callId -BodyParameter $params
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
from msgraph import GraphServiceClient
from msgraph.generated.models.transfer_post_request_body import TransferPostRequestBody
from msgraph.generated.models.invitation_participant_info import InvitationParticipantInfo
from msgraph.generated.models.identity_set import IdentitySet
from msgraph.generated.models.identity import Identity
graph_client = GraphServiceClient(credentials, scopes)
request_body = TransferPostRequestBody(
transfer_target = InvitationParticipantInfo(
identity = IdentitySet(
additional_data = {
"phone" : {
"@odata_type" : "#microsoft.graph.identity",
"id" : "+12345678901",
},
}
),
additional_data = {
"endpoint_type" : "default",
"language_id" : "languageId-value",
"region" : "region-value",
}
),
additional_data = {
"client_context" : "9e90d1c1-f61e-43e7-9f75-d420159aae08",
}
)
await graph_client.communications.calls.by_call_id('call-id').transfer.post(request_body)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
応答
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
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/v1.0/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"
},
"clientContext": "9e90d1c1-f61e-43e7-9f75-d420159aae08"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Communications.Calls.Item.Transfer;
using Microsoft.Graph.Models;
var requestBody = new TransferPostRequestBody
{
TransferTarget = new InvitationParticipantInfo
{
OdataType = "#microsoft.graph.invitationParticipantInfo",
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>
{
{
"endpointType" , "default"
},
{
"languageId" , "en-us"
},
{
"region" , "amer"
},
},
},
AdditionalData = new Dictionary<string, object>
{
{
"clientContext" , "9e90d1c1-f61e-43e7-9f75-d420159aae08"
},
},
};
// 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);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc 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"\
},\
"clientContext": "9e90d1c1-f61e-43e7-9f75-d420159aae08"\
}\
'
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
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.NewTransferPostRequestBody()
transferTarget := graphmodels.NewInvitationParticipantInfo()
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{}{
"endpointType" : "default",
"languageId" : "en-us",
"region" : "amer",
}
transferTarget.SetAdditionalData(additionalData)
requestBody.SetTransferTarget(transferTarget)
additionalData := map[string]interface{}{
"clientContext" : "9e90d1c1-f61e-43e7-9f75-d420159aae08",
}
requestBody.SetAdditionalData(additionalData)
graphClient.Communications().Calls().ByCallId("call-id").Transfer().Post(context.Background(), requestBody, nil)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.communications.calls.item.transfer.TransferPostRequestBody transferPostRequestBody = new com.microsoft.graph.communications.calls.item.transfer.TransferPostRequestBody();
InvitationParticipantInfo transferTarget = new InvitationParticipantInfo();
transferTarget.setOdataType("#microsoft.graph.invitationParticipantInfo");
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("endpointType", "default");
additionalData1.put("languageId", "en-us");
additionalData1.put("region", "amer");
transferTarget.setAdditionalData(additionalData1);
transferPostRequestBody.setTransferTarget(transferTarget);
HashMap<String, Object> additionalData2 = new HashMap<String, Object>();
additionalData2.put("clientContext", "9e90d1c1-f61e-43e7-9f75-d420159aae08");
transferPostRequestBody.setAdditionalData(additionalData2);
graphClient.communications().calls().byCallId("{call-id}").transfer().post(transferPostRequestBody);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
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'
},
clientContext: '9e90d1c1-f61e-43e7-9f75-d420159aae08'
};
await client.api('/communications/calls/341a0500-d4bf-4224-8b19-1581168d328b/transfer')
.post(transfer);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\TransferPostRequestBody;
use Microsoft\Graph\Generated\Models\InvitationParticipantInfo;
use Microsoft\Graph\Generated\Models\IdentitySet;
use Microsoft\Graph\Generated\Models\Identity;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new TransferPostRequestBody();
$transferTarget = new InvitationParticipantInfo();
$transferTarget->setOdataType('#microsoft.graph.invitationParticipantInfo');
$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 = [
'endpointType' => 'default',
'languageId' => 'en-us',
'region' => 'amer',
];
$transferTarget->setAdditionalData($additionalData);
$requestBody->setTransferTarget($transferTarget);
$additionalData = [
'clientContext' => '9e90d1c1-f61e-43e7-9f75-d420159aae08',
];
$requestBody->setAdditionalData($additionalData);
$graphServiceClient->communications()->calls()->byCallId('call-id')->transfer()->post($requestBody)->wait();
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
Import-Module Microsoft.Graph.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"
}
clientContext = "9e90d1c1-f61e-43e7-9f75-d420159aae08"
}
Move-MgCommunicationCall -CallId $callId -BodyParameter $params
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
from msgraph import GraphServiceClient
from msgraph.generated.models.transfer_post_request_body import TransferPostRequestBody
from msgraph.generated.models.invitation_participant_info import InvitationParticipantInfo
from msgraph.generated.models.identity_set import IdentitySet
from msgraph.generated.models.identity import Identity
graph_client = GraphServiceClient(credentials, scopes)
request_body = TransferPostRequestBody(
transfer_target = InvitationParticipantInfo(
odata_type = "#microsoft.graph.invitationParticipantInfo",
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 = {
"endpoint_type" : "default",
"language_id" : "en-us",
"region" : "amer",
}
),
additional_data = {
"client_context" : "9e90d1c1-f61e-43e7-9f75-d420159aae08",
}
)
await graph_client.communications.calls.by_call_id('call-id').transfer.post(request_body)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
応答
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
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: グループ呼び出しからの通話転送
メモ: グループ呼び出しから転送するには、transferee パラメーターが必要です。 他のすべてのパラメーターは、ピアツーピア呼び出しからの転送のパラメーターと同じです。 グループ呼び出しからのコンサルティング転送またはグループ呼び出しからの PSTN への転送は、例 1 から 4 に似ています。transferee パラメーターを指定します。
要求
次の例は要求を示しています。
POST https://graph.microsoft.com/v1.0/communications/calls/{id}/transfer
Content-Type: application/json
Content-Length: 430
{
"transferTarget": {
"endpointType": "default",
"identity": {
"user": {
"id": "550fae72-d251-43ec-868c-373732c2704f",
"displayName": "Heidi Steen"
}
},
},
"transferee": {
"identity": {
"user": {
"id": "751f6800-3180-414d-bd94-333364659951",
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47"
}
},
"participantId": "909c6581-5130-43e9-88f3-fcb3582cde37"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Communications.Calls.Item.Transfer;
using Microsoft.Graph.Models;
var requestBody = new TransferPostRequestBody
{
TransferTarget = new InvitationParticipantInfo
{
Identity = new IdentitySet
{
User = new Identity
{
Id = "550fae72-d251-43ec-868c-373732c2704f",
DisplayName = "Heidi Steen",
},
},
AdditionalData = new Dictionary<string, object>
{
{
"endpointType" , "default"
},
},
},
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",
},
};
// 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);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc communications calls transfer post --call-id {call-id} --body '{\
"transferTarget": {\
"endpointType": "default",\
"identity": {\
"user": {\
"id": "550fae72-d251-43ec-868c-373732c2704f",\
"displayName": "Heidi Steen"\
}\
},\
},\
"transferee": {\
"identity": {\
"user": {\
"id": "751f6800-3180-414d-bd94-333364659951",\
"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47"\
}\
},\
"participantId": "909c6581-5130-43e9-88f3-fcb3582cde37"\
}\
}\
'
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
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.NewTransferPostRequestBody()
transferTarget := graphmodels.NewInvitationParticipantInfo()
identity := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
id := "550fae72-d251-43ec-868c-373732c2704f"
user.SetId(&id)
displayName := "Heidi Steen"
user.SetDisplayName(&displayName)
identity.SetUser(user)
transferTarget.SetIdentity(identity)
additionalData := map[string]interface{}{
"endpointType" : "default",
}
transferTarget.SetAdditionalData(additionalData)
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)
graphClient.Communications().Calls().ByCallId("call-id").Transfer().Post(context.Background(), requestBody, nil)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.communications.calls.item.transfer.TransferPostRequestBody transferPostRequestBody = new com.microsoft.graph.communications.calls.item.transfer.TransferPostRequestBody();
InvitationParticipantInfo transferTarget = new InvitationParticipantInfo();
IdentitySet identity = new IdentitySet();
Identity user = new Identity();
user.setId("550fae72-d251-43ec-868c-373732c2704f");
user.setDisplayName("Heidi Steen");
identity.setUser(user);
transferTarget.setIdentity(identity);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("endpointType", "default");
transferTarget.setAdditionalData(additionalData);
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);
graphClient.communications().calls().byCallId("{call-id}").transfer().post(transferPostRequestBody);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const transfer = {
transferTarget: {
endpointType: 'default',
identity: {
user: {
id: '550fae72-d251-43ec-868c-373732c2704f',
displayName: 'Heidi Steen'
}
},
},
transferee: {
identity: {
user: {
id: '751f6800-3180-414d-bd94-333364659951',
tenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47'
}
},
participantId: '909c6581-5130-43e9-88f3-fcb3582cde37'
}
};
await client.api('/communications/calls/{id}/transfer')
.post(transfer);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\TransferPostRequestBody;
use Microsoft\Graph\Generated\Models\InvitationParticipantInfo;
use Microsoft\Graph\Generated\Models\IdentitySet;
use Microsoft\Graph\Generated\Models\Identity;
use Microsoft\Graph\Generated\Models\ParticipantInfo;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new TransferPostRequestBody();
$transferTarget = new InvitationParticipantInfo();
$transferTargetIdentity = new IdentitySet();
$transferTargetIdentityUser = new Identity();
$transferTargetIdentityUser->setId('550fae72-d251-43ec-868c-373732c2704f');
$transferTargetIdentityUser->setDisplayName('Heidi Steen');
$transferTargetIdentity->setUser($transferTargetIdentityUser);
$transferTarget->setIdentity($transferTargetIdentity);
$additionalData = [
'endpointType' => 'default',
];
$transferTarget->setAdditionalData($additionalData);
$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);
$graphServiceClient->communications()->calls()->byCallId('call-id')->transfer()->post($requestBody)->wait();
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
Import-Module Microsoft.Graph.CloudCommunications
$params = @{
transferTarget = @{
endpointType = "default"
identity = @{
user = @{
id = "550fae72-d251-43ec-868c-373732c2704f"
displayName = "Heidi Steen"
}
}
}
transferee = @{
identity = @{
user = @{
id = "751f6800-3180-414d-bd94-333364659951"
tenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47"
}
}
participantId = "909c6581-5130-43e9-88f3-fcb3582cde37"
}
}
Move-MgCommunicationCall -CallId $callId -BodyParameter $params
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
from msgraph import GraphServiceClient
from msgraph.generated.models.transfer_post_request_body import TransferPostRequestBody
from msgraph.generated.models.invitation_participant_info import InvitationParticipantInfo
from msgraph.generated.models.identity_set import IdentitySet
from msgraph.generated.models.identity import Identity
from msgraph.generated.models.participant_info import ParticipantInfo
graph_client = GraphServiceClient(credentials, scopes)
request_body = TransferPostRequestBody(
transfer_target = InvitationParticipantInfo(
identity = IdentitySet(
user = Identity(
id = "550fae72-d251-43ec-868c-373732c2704f",
display_name = "Heidi Steen",
),
),
additional_data = {
"endpoint_type" : "default",
}
),
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",
),
)
await graph_client.communications.calls.by_call_id('call-id').transfer.post(request_body)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
応答
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>"
}
}
}
]
}