As APIs na versão /beta no Microsoft Graph estão sujeitas a alterações. Não há suporte para o uso dessas APIs em aplicativos de produção. Para determinar se uma API está disponível na v1.0, use o seletor Versão.
Criar chamada permite que o bot crie uma nova chamada ponto a ponto ou de grupo ou participe numa reunião existente. Tem de registar o bot de chamada e percorrer a lista de permissões necessárias.
Esta API suporta os seguintes cenários RTPC:
Chamada recebida para o número RTPC do bot e, em seguida, o bot convida outra RTPC.
Chamada recebida para o número RTPC do bot e, em seguida, transferência do bot para outra RTPC.
Chamada recebida para o número RTPC do bot e, em seguida, o bot redireciona para outra RTPC.
Chamada recebida para o identificador de instância do bot e, em seguida, o bot convida outra RTPC.
Chamada recebida para o identificador de instância do bot e, em seguida, transferência do bot para outra RTPC.
Chamada recebida para o identificador de instância do bot e, em seguida, o bot redireciona para outra RTPC.
Chamada recebida para o identificador de instância do bot a partir da Reunião Agendada e, em seguida, o bot convida a RTPC.
Chamada efetuada do bot (com identificador de instância) para uma RTPC.
Chamada P2P entre o bot e outro elemento da rede (utilizador do Teams, RTPC), o bot convida outra RTPC.
Chamada P2P entre o bot e outro elemento da rede (utilizador do Teams, RTPC), o bot convida outro utilizador do Teams.
O bot participa na reunião agendada e, em seguida, convida a RTPC.
Escolha a permissão ou permissões marcadas como menos privilegiadas para esta API. Utilize uma permissão ou permissões com privilégios mais elevados apenas se a sua aplicação o exigir. Para obter detalhes sobre as permissões delegadas e de aplicação, veja Tipos de permissão. Para saber mais sobre estas permissões, veja a referência de permissões.
Para uma chamada com suportes de dados alojados na aplicação, precisa da permissão Calls.AccessMedia.All para além de uma das permissões listadas na tabela anterior.
As soluções Cloud Video Interop certificadas para o Microsoft Teams têm permissão para chamar esta API para participar em reuniões para as quais têm ligações de participação em reuniões, semelhantes aos utilizadores externos que se juntam através de um browser.
Solicitação HTTP
POST /app/calls
POST /communications/calls
Observação: o caminho /app foi preterido. Daqui em diante, use o caminho /communications.
No corpo do pedido, forneça uma representação JSON de um objeto de chamada .
Resposta
Se for bem-sucedido, este método devolve um 201 Created código de resposta e um objeto de chamada no corpo da resposta.
Exemplos
Exemplo 1: Criar uma chamada VoIP ponto a ponto com suportes de dados alojados pelo serviço
Nota: Esta chamada precisa da permissão Calls.Initiate.All.
Solicitação
O exemplo seguinte mostra um pedido que faz uma chamada ponto a ponto entre o bot e o utilizador especificado. Neste exemplo, o suporte de dados é alojado pelo serviço. Os valores de token de autorização, URL de chamada de retorno, ID da aplicação, nome da aplicação, ID de utilizador, nome de utilizador e ID de inquilino têm de ser substituídos por valores reais para que o exemplo funcione.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Call
{
OdataType = "#microsoft.graph.call",
CallbackUri = "https://bot.contoso.com/callback",
Targets = new List<InvitationParticipantInfo>
{
new InvitationParticipantInfo
{
OdataType = "#microsoft.graph.invitationParticipantInfo",
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
User = new Identity
{
OdataType = "#microsoft.graph.identity",
DisplayName = "John",
Id = "112f7296-5fa4-42ca-bae8-6a692b15d4b8",
},
},
},
},
RequestedModalities = new List<Modality?>
{
Modality.Audio,
},
CallOptions = new OutgoingCallOptions
{
OdataType = "#microsoft.graph.outgoingCallOptions",
IsContentSharingNotificationEnabled = true,
IsDeltaRosterEnabled = true,
},
MediaConfig = new ServiceHostedMediaConfig
{
OdataType = "#microsoft.graph.serviceHostedMediaConfig",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Communications.Calls.PostAsync(requestBody);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// 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"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewCall()
callbackUri := "https://bot.contoso.com/callback"
requestBody.SetCallbackUri(&callbackUri)
invitationParticipantInfo := graphmodels.NewInvitationParticipantInfo()
identity := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
displayName := "John"
user.SetDisplayName(&displayName)
id := "112f7296-5fa4-42ca-bae8-6a692b15d4b8"
user.SetId(&id)
identity.SetUser(user)
invitationParticipantInfo.SetIdentity(identity)
targets := []graphmodels.InvitationParticipantInfoable {
invitationParticipantInfo,
}
requestBody.SetTargets(targets)
requestedModalities := []graphmodels.Modalityable {
modality := graphmodels.AUDIO_MODALITY
requestBody.SetModality(&modality)
}
requestBody.SetRequestedModalities(requestedModalities)
callOptions := graphmodels.NewOutgoingCallOptions()
isContentSharingNotificationEnabled := true
callOptions.SetIsContentSharingNotificationEnabled(&isContentSharingNotificationEnabled)
isDeltaRosterEnabled := true
callOptions.SetIsDeltaRosterEnabled(&isDeltaRosterEnabled)
requestBody.SetCallOptions(callOptions)
mediaConfig := graphmodels.NewServiceHostedMediaConfig()
requestBody.SetMediaConfig(mediaConfig)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
calls, err := graphClient.Communications().Calls().Post(context.Background(), requestBody, nil)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Call call = new Call();
call.setOdataType("#microsoft.graph.call");
call.setCallbackUri("https://bot.contoso.com/callback");
LinkedList<InvitationParticipantInfo> targets = new LinkedList<InvitationParticipantInfo>();
InvitationParticipantInfo invitationParticipantInfo = new InvitationParticipantInfo();
invitationParticipantInfo.setOdataType("#microsoft.graph.invitationParticipantInfo");
IdentitySet identity = new IdentitySet();
identity.setOdataType("#microsoft.graph.identitySet");
Identity user = new Identity();
user.setOdataType("#microsoft.graph.identity");
user.setDisplayName("John");
user.setId("112f7296-5fa4-42ca-bae8-6a692b15d4b8");
identity.setUser(user);
invitationParticipantInfo.setIdentity(identity);
targets.add(invitationParticipantInfo);
call.setTargets(targets);
LinkedList<Modality> requestedModalities = new LinkedList<Modality>();
requestedModalities.add(Modality.Audio);
call.setRequestedModalities(requestedModalities);
OutgoingCallOptions callOptions = new OutgoingCallOptions();
callOptions.setOdataType("#microsoft.graph.outgoingCallOptions");
callOptions.setIsContentSharingNotificationEnabled(true);
callOptions.setIsDeltaRosterEnabled(true);
call.setCallOptions(callOptions);
ServiceHostedMediaConfig mediaConfig = new ServiceHostedMediaConfig();
mediaConfig.setOdataType("#microsoft.graph.serviceHostedMediaConfig");
call.setMediaConfig(mediaConfig);
Call result = graphClient.communications().calls().post(call);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Call;
use Microsoft\Graph\Beta\Generated\Models\InvitationParticipantInfo;
use Microsoft\Graph\Beta\Generated\Models\IdentitySet;
use Microsoft\Graph\Beta\Generated\Models\Identity;
use Microsoft\Graph\Beta\Generated\Models\Modality;
use Microsoft\Graph\Beta\Generated\Models\OutgoingCallOptions;
use Microsoft\Graph\Beta\Generated\Models\ServiceHostedMediaConfig;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Call();
$requestBody->setOdataType('#microsoft.graph.call');
$requestBody->setCallbackUri('https://bot.contoso.com/callback');
$targetsInvitationParticipantInfo1 = new InvitationParticipantInfo();
$targetsInvitationParticipantInfo1->setOdataType('#microsoft.graph.invitationParticipantInfo');
$targetsInvitationParticipantInfo1Identity = new IdentitySet();
$targetsInvitationParticipantInfo1Identity->setOdataType('#microsoft.graph.identitySet');
$targetsInvitationParticipantInfo1IdentityUser = new Identity();
$targetsInvitationParticipantInfo1IdentityUser->setOdataType('#microsoft.graph.identity');
$targetsInvitationParticipantInfo1IdentityUser->setDisplayName('John');
$targetsInvitationParticipantInfo1IdentityUser->setId('112f7296-5fa4-42ca-bae8-6a692b15d4b8');
$targetsInvitationParticipantInfo1Identity->setUser($targetsInvitationParticipantInfo1IdentityUser);
$targetsInvitationParticipantInfo1->setIdentity($targetsInvitationParticipantInfo1Identity);
$targetsArray []= $targetsInvitationParticipantInfo1;
$requestBody->setTargets($targetsArray);
$requestBody->setRequestedModalities([new Modality('audio'),]);
$callOptions = new OutgoingCallOptions();
$callOptions->setOdataType('#microsoft.graph.outgoingCallOptions');
$callOptions->setIsContentSharingNotificationEnabled(true);
$callOptions->setIsDeltaRosterEnabled(true);
$requestBody->setCallOptions($callOptions);
$mediaConfig = new ServiceHostedMediaConfig();
$mediaConfig->setOdataType('#microsoft.graph.serviceHostedMediaConfig');
$requestBody->setMediaConfig($mediaConfig);
$result = $graphServiceClient->communications()->calls()->post($requestBody)->wait();
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.call import Call
from msgraph_beta.generated.models.invitation_participant_info import InvitationParticipantInfo
from msgraph_beta.generated.models.identity_set import IdentitySet
from msgraph_beta.generated.models.identity import Identity
from msgraph_beta.generated.models.modality import Modality
from msgraph_beta.generated.models.outgoing_call_options import OutgoingCallOptions
from msgraph_beta.generated.models.service_hosted_media_config import ServiceHostedMediaConfig
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Call(
odata_type = "#microsoft.graph.call",
callback_uri = "https://bot.contoso.com/callback",
targets = [
InvitationParticipantInfo(
odata_type = "#microsoft.graph.invitationParticipantInfo",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
user = Identity(
odata_type = "#microsoft.graph.identity",
display_name = "John",
id = "112f7296-5fa4-42ca-bae8-6a692b15d4b8",
),
),
),
],
requested_modalities = [
Modality.Audio,
],
call_options = OutgoingCallOptions(
odata_type = "#microsoft.graph.outgoingCallOptions",
is_content_sharing_notification_enabled = True,
is_delta_roster_enabled = True,
),
media_config = ServiceHostedMediaConfig(
odata_type = "#microsoft.graph.serviceHostedMediaConfig",
),
)
result = await graph_client.communications.calls.post(request_body)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Exemplo 2: Criar uma chamada VoIP ponto a ponto com suportes de dados alojados na aplicação
Nota: este exemplo precisa de permissões Calls.Initiate.All e Calls.AccessMedia.All.
Solicitação
O exemplo seguinte mostra um pedido que faz uma chamada ponto a ponto entre o bot e o utilizador especificado. Neste exemplo, o suporte de dados é alojado localmente pela aplicação. Os valores de token de autorização, URL de chamada de retorno, ID da aplicação, nome da aplicação, ID de utilizador, nome de utilizador e ID de inquilino têm de ser substituídos por valores reais para que o exemplo funcione.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Call
{
OdataType = "#microsoft.graph.call",
CallbackUri = "https://bot.contoso.com/callback",
Source = new ParticipantInfo
{
OdataType = "#microsoft.graph.participantInfo",
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
Application = new Identity
{
OdataType = "#microsoft.graph.identity",
DisplayName = "Calling Bot",
Id = "2891555a-92ff-42e6-80fa-6e1300c6b5c6",
},
},
Region = null,
LanguageId = null,
},
Targets = new List<InvitationParticipantInfo>
{
new InvitationParticipantInfo
{
OdataType = "#microsoft.graph.invitationParticipantInfo",
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
User = new Identity
{
OdataType = "#microsoft.graph.identity",
DisplayName = "John",
Id = "112f7296-5fa4-42ca-bae8-6a692b15d4b8",
},
},
},
},
RequestedModalities = new List<Modality?>
{
Modality.Audio,
},
MediaConfig = new AppHostedMediaConfig
{
OdataType = "#microsoft.graph.appHostedMediaConfig",
Blob = "<Media Session Configuration>",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Communications.Calls.PostAsync(requestBody);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// 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"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewCall()
callbackUri := "https://bot.contoso.com/callback"
requestBody.SetCallbackUri(&callbackUri)
source := graphmodels.NewParticipantInfo()
identity := graphmodels.NewIdentitySet()
application := graphmodels.NewIdentity()
displayName := "Calling Bot"
application.SetDisplayName(&displayName)
id := "2891555a-92ff-42e6-80fa-6e1300c6b5c6"
application.SetId(&id)
identity.SetApplication(application)
source.SetIdentity(identity)
region := null
source.SetRegion(®ion)
languageId := null
source.SetLanguageId(&languageId)
requestBody.SetSource(source)
invitationParticipantInfo := graphmodels.NewInvitationParticipantInfo()
identity := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
displayName := "John"
user.SetDisplayName(&displayName)
id := "112f7296-5fa4-42ca-bae8-6a692b15d4b8"
user.SetId(&id)
identity.SetUser(user)
invitationParticipantInfo.SetIdentity(identity)
targets := []graphmodels.InvitationParticipantInfoable {
invitationParticipantInfo,
}
requestBody.SetTargets(targets)
requestedModalities := []graphmodels.Modalityable {
modality := graphmodels.AUDIO_MODALITY
requestBody.SetModality(&modality)
}
requestBody.SetRequestedModalities(requestedModalities)
mediaConfig := graphmodels.NewAppHostedMediaConfig()
blob := "<Media Session Configuration>"
mediaConfig.SetBlob(&blob)
requestBody.SetMediaConfig(mediaConfig)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
calls, err := graphClient.Communications().Calls().Post(context.Background(), requestBody, nil)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Call call = new Call();
call.setOdataType("#microsoft.graph.call");
call.setCallbackUri("https://bot.contoso.com/callback");
ParticipantInfo source = new ParticipantInfo();
source.setOdataType("#microsoft.graph.participantInfo");
IdentitySet identity = new IdentitySet();
identity.setOdataType("#microsoft.graph.identitySet");
Identity application = new Identity();
application.setOdataType("#microsoft.graph.identity");
application.setDisplayName("Calling Bot");
application.setId("2891555a-92ff-42e6-80fa-6e1300c6b5c6");
identity.setApplication(application);
source.setIdentity(identity);
source.setRegion(null);
source.setLanguageId(null);
call.setSource(source);
LinkedList<InvitationParticipantInfo> targets = new LinkedList<InvitationParticipantInfo>();
InvitationParticipantInfo invitationParticipantInfo = new InvitationParticipantInfo();
invitationParticipantInfo.setOdataType("#microsoft.graph.invitationParticipantInfo");
IdentitySet identity1 = new IdentitySet();
identity1.setOdataType("#microsoft.graph.identitySet");
Identity user = new Identity();
user.setOdataType("#microsoft.graph.identity");
user.setDisplayName("John");
user.setId("112f7296-5fa4-42ca-bae8-6a692b15d4b8");
identity1.setUser(user);
invitationParticipantInfo.setIdentity(identity1);
targets.add(invitationParticipantInfo);
call.setTargets(targets);
LinkedList<Modality> requestedModalities = new LinkedList<Modality>();
requestedModalities.add(Modality.Audio);
call.setRequestedModalities(requestedModalities);
AppHostedMediaConfig mediaConfig = new AppHostedMediaConfig();
mediaConfig.setOdataType("#microsoft.graph.appHostedMediaConfig");
mediaConfig.setBlob("<Media Session Configuration>");
call.setMediaConfig(mediaConfig);
Call result = graphClient.communications().calls().post(call);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Call;
use Microsoft\Graph\Beta\Generated\Models\ParticipantInfo;
use Microsoft\Graph\Beta\Generated\Models\IdentitySet;
use Microsoft\Graph\Beta\Generated\Models\Identity;
use Microsoft\Graph\Beta\Generated\Models\InvitationParticipantInfo;
use Microsoft\Graph\Beta\Generated\Models\Modality;
use Microsoft\Graph\Beta\Generated\Models\AppHostedMediaConfig;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Call();
$requestBody->setOdataType('#microsoft.graph.call');
$requestBody->setCallbackUri('https://bot.contoso.com/callback');
$source = new ParticipantInfo();
$source->setOdataType('#microsoft.graph.participantInfo');
$sourceIdentity = new IdentitySet();
$sourceIdentity->setOdataType('#microsoft.graph.identitySet');
$sourceIdentityApplication = new Identity();
$sourceIdentityApplication->setOdataType('#microsoft.graph.identity');
$sourceIdentityApplication->setDisplayName('Calling Bot');
$sourceIdentityApplication->setId('2891555a-92ff-42e6-80fa-6e1300c6b5c6');
$sourceIdentity->setApplication($sourceIdentityApplication);
$source->setIdentity($sourceIdentity);
$source->setRegion(null);
$source->setLanguageId(null);
$requestBody->setSource($source);
$targetsInvitationParticipantInfo1 = new InvitationParticipantInfo();
$targetsInvitationParticipantInfo1->setOdataType('#microsoft.graph.invitationParticipantInfo');
$targetsInvitationParticipantInfo1Identity = new IdentitySet();
$targetsInvitationParticipantInfo1Identity->setOdataType('#microsoft.graph.identitySet');
$targetsInvitationParticipantInfo1IdentityUser = new Identity();
$targetsInvitationParticipantInfo1IdentityUser->setOdataType('#microsoft.graph.identity');
$targetsInvitationParticipantInfo1IdentityUser->setDisplayName('John');
$targetsInvitationParticipantInfo1IdentityUser->setId('112f7296-5fa4-42ca-bae8-6a692b15d4b8');
$targetsInvitationParticipantInfo1Identity->setUser($targetsInvitationParticipantInfo1IdentityUser);
$targetsInvitationParticipantInfo1->setIdentity($targetsInvitationParticipantInfo1Identity);
$targetsArray []= $targetsInvitationParticipantInfo1;
$requestBody->setTargets($targetsArray);
$requestBody->setRequestedModalities([new Modality('audio'),]);
$mediaConfig = new AppHostedMediaConfig();
$mediaConfig->setOdataType('#microsoft.graph.appHostedMediaConfig');
$mediaConfig->setBlob('<Media Session Configuration>');
$requestBody->setMediaConfig($mediaConfig);
$result = $graphServiceClient->communications()->calls()->post($requestBody)->wait();
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.call import Call
from msgraph_beta.generated.models.participant_info import ParticipantInfo
from msgraph_beta.generated.models.identity_set import IdentitySet
from msgraph_beta.generated.models.identity import Identity
from msgraph_beta.generated.models.invitation_participant_info import InvitationParticipantInfo
from msgraph_beta.generated.models.modality import Modality
from msgraph_beta.generated.models.app_hosted_media_config import AppHostedMediaConfig
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Call(
odata_type = "#microsoft.graph.call",
callback_uri = "https://bot.contoso.com/callback",
source = ParticipantInfo(
odata_type = "#microsoft.graph.participantInfo",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
application = Identity(
odata_type = "#microsoft.graph.identity",
display_name = "Calling Bot",
id = "2891555a-92ff-42e6-80fa-6e1300c6b5c6",
),
),
region = None,
language_id = None,
),
targets = [
InvitationParticipantInfo(
odata_type = "#microsoft.graph.invitationParticipantInfo",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
user = Identity(
odata_type = "#microsoft.graph.identity",
display_name = "John",
id = "112f7296-5fa4-42ca-bae8-6a692b15d4b8",
),
),
),
],
requested_modalities = [
Modality.Audio,
],
media_config = AppHostedMediaConfig(
odata_type = "#microsoft.graph.appHostedMediaConfig",
blob = "<Media Session Configuration>",
),
)
result = await graph_client.communications.calls.post(request_body)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
<Media Session Configuration> é a configuração de sessão de multimédia serializada, que contém as informações de sessão da pilha de multimédia. As informações específicas sobre áudio, vídeo e informações de sessão VBSS devem ser transmitidas aqui.
Segue-se um exemplo de um blob de sessão de multimédia de áudio.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Call
{
OdataType = "#microsoft.graph.call",
Direction = CallDirection.Outgoing,
Subject = "Create a group call with service hosted media",
CallbackUri = "https://bot.contoso.com/callback",
Source = new ParticipantInfo
{
OdataType = "#microsoft.graph.participantInfo",
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
Application = new Identity
{
OdataType = "#microsoft.graph.identity",
DisplayName = "TestBot",
Id = "dd3885da-f9ab-486b-bfae-85de3d445555",
},
},
},
Targets = new List<InvitationParticipantInfo>
{
new InvitationParticipantInfo
{
OdataType = "#microsoft.graph.invitationParticipantInfo",
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
User = new Identity
{
OdataType = "#microsoft.graph.identity",
DisplayName = "user1",
Id = "98da8a1a-1b87-452c-a713-65d3f10b5555",
},
},
},
new ParticipantInfo
{
OdataType = "#microsoft.graph.participantInfo",
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
User = new Identity
{
OdataType = "#microsoft.graph.identity",
DisplayName = "user2",
Id = "bf5aae9a-d11d-47a8-93b1-782504c95555",
},
},
},
},
RequestedModalities = new List<Modality?>
{
Modality.Audio,
},
MediaConfig = new ServiceHostedMediaConfig
{
OdataType = "#microsoft.graph.serviceHostedMediaConfig",
RemoveFromDefaultAudioGroup = false,
},
TenantId = "aa67bd4c-8475-432d-bd41-39f255720e0a",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Communications.Calls.PostAsync(requestBody);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// 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"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewCall()
direction := graphmodels.OUTGOING_CALLDIRECTION
requestBody.SetDirection(&direction)
subject := "Create a group call with service hosted media"
requestBody.SetSubject(&subject)
callbackUri := "https://bot.contoso.com/callback"
requestBody.SetCallbackUri(&callbackUri)
source := graphmodels.NewParticipantInfo()
identity := graphmodels.NewIdentitySet()
application := graphmodels.NewIdentity()
displayName := "TestBot"
application.SetDisplayName(&displayName)
id := "dd3885da-f9ab-486b-bfae-85de3d445555"
application.SetId(&id)
identity.SetApplication(application)
source.SetIdentity(identity)
requestBody.SetSource(source)
invitationParticipantInfo := graphmodels.NewInvitationParticipantInfo()
identity := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
displayName := "user1"
user.SetDisplayName(&displayName)
id := "98da8a1a-1b87-452c-a713-65d3f10b5555"
user.SetId(&id)
identity.SetUser(user)
invitationParticipantInfo.SetIdentity(identity)
invitationParticipantInfo1 := graphmodels.NewParticipantInfo()
identity := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
displayName := "user2"
user.SetDisplayName(&displayName)
id := "bf5aae9a-d11d-47a8-93b1-782504c95555"
user.SetId(&id)
identity.SetUser(user)
invitationParticipantInfo1.SetIdentity(identity)
targets := []graphmodels.InvitationParticipantInfoable {
invitationParticipantInfo,
invitationParticipantInfo1,
}
requestBody.SetTargets(targets)
requestedModalities := []graphmodels.Modalityable {
modality := graphmodels.AUDIO_MODALITY
requestBody.SetModality(&modality)
}
requestBody.SetRequestedModalities(requestedModalities)
mediaConfig := graphmodels.NewServiceHostedMediaConfig()
removeFromDefaultAudioGroup := false
mediaConfig.SetRemoveFromDefaultAudioGroup(&removeFromDefaultAudioGroup)
requestBody.SetMediaConfig(mediaConfig)
tenantId := "aa67bd4c-8475-432d-bd41-39f255720e0a"
requestBody.SetTenantId(&tenantId)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
calls, err := graphClient.Communications().Calls().Post(context.Background(), requestBody, nil)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Call call = new Call();
call.setOdataType("#microsoft.graph.call");
call.setDirection(CallDirection.Outgoing);
call.setSubject("Create a group call with service hosted media");
call.setCallbackUri("https://bot.contoso.com/callback");
ParticipantInfo source = new ParticipantInfo();
source.setOdataType("#microsoft.graph.participantInfo");
IdentitySet identity = new IdentitySet();
identity.setOdataType("#microsoft.graph.identitySet");
Identity application = new Identity();
application.setOdataType("#microsoft.graph.identity");
application.setDisplayName("TestBot");
application.setId("dd3885da-f9ab-486b-bfae-85de3d445555");
identity.setApplication(application);
source.setIdentity(identity);
call.setSource(source);
LinkedList<InvitationParticipantInfo> targets = new LinkedList<InvitationParticipantInfo>();
InvitationParticipantInfo invitationParticipantInfo = new InvitationParticipantInfo();
invitationParticipantInfo.setOdataType("#microsoft.graph.invitationParticipantInfo");
IdentitySet identity1 = new IdentitySet();
identity1.setOdataType("#microsoft.graph.identitySet");
Identity user = new Identity();
user.setOdataType("#microsoft.graph.identity");
user.setDisplayName("user1");
user.setId("98da8a1a-1b87-452c-a713-65d3f10b5555");
identity1.setUser(user);
invitationParticipantInfo.setIdentity(identity1);
targets.add(invitationParticipantInfo);
ParticipantInfo invitationParticipantInfo1 = new ParticipantInfo();
invitationParticipantInfo1.setOdataType("#microsoft.graph.participantInfo");
IdentitySet identity2 = new IdentitySet();
identity2.setOdataType("#microsoft.graph.identitySet");
Identity user1 = new Identity();
user1.setOdataType("#microsoft.graph.identity");
user1.setDisplayName("user2");
user1.setId("bf5aae9a-d11d-47a8-93b1-782504c95555");
identity2.setUser(user1);
invitationParticipantInfo1.setIdentity(identity2);
targets.add(invitationParticipantInfo1);
call.setTargets(targets);
LinkedList<Modality> requestedModalities = new LinkedList<Modality>();
requestedModalities.add(Modality.Audio);
call.setRequestedModalities(requestedModalities);
ServiceHostedMediaConfig mediaConfig = new ServiceHostedMediaConfig();
mediaConfig.setOdataType("#microsoft.graph.serviceHostedMediaConfig");
mediaConfig.setRemoveFromDefaultAudioGroup(false);
call.setMediaConfig(mediaConfig);
call.setTenantId("aa67bd4c-8475-432d-bd41-39f255720e0a");
Call result = graphClient.communications().calls().post(call);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Call;
use Microsoft\Graph\Beta\Generated\Models\CallDirection;
use Microsoft\Graph\Beta\Generated\Models\ParticipantInfo;
use Microsoft\Graph\Beta\Generated\Models\IdentitySet;
use Microsoft\Graph\Beta\Generated\Models\Identity;
use Microsoft\Graph\Beta\Generated\Models\InvitationParticipantInfo;
use Microsoft\Graph\Beta\Generated\Models\Modality;
use Microsoft\Graph\Beta\Generated\Models\ServiceHostedMediaConfig;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Call();
$requestBody->setOdataType('#microsoft.graph.call');
$requestBody->setDirection(new CallDirection('outgoing'));
$requestBody->setSubject('Create a group call with service hosted media');
$requestBody->setCallbackUri('https://bot.contoso.com/callback');
$source = new ParticipantInfo();
$source->setOdataType('#microsoft.graph.participantInfo');
$sourceIdentity = new IdentitySet();
$sourceIdentity->setOdataType('#microsoft.graph.identitySet');
$sourceIdentityApplication = new Identity();
$sourceIdentityApplication->setOdataType('#microsoft.graph.identity');
$sourceIdentityApplication->setDisplayName('TestBot');
$sourceIdentityApplication->setId('dd3885da-f9ab-486b-bfae-85de3d445555');
$sourceIdentity->setApplication($sourceIdentityApplication);
$source->setIdentity($sourceIdentity);
$requestBody->setSource($source);
$targetsInvitationParticipantInfo1 = new InvitationParticipantInfo();
$targetsInvitationParticipantInfo1->setOdataType('#microsoft.graph.invitationParticipantInfo');
$targetsInvitationParticipantInfo1Identity = new IdentitySet();
$targetsInvitationParticipantInfo1Identity->setOdataType('#microsoft.graph.identitySet');
$targetsInvitationParticipantInfo1IdentityUser = new Identity();
$targetsInvitationParticipantInfo1IdentityUser->setOdataType('#microsoft.graph.identity');
$targetsInvitationParticipantInfo1IdentityUser->setDisplayName('user1');
$targetsInvitationParticipantInfo1IdentityUser->setId('98da8a1a-1b87-452c-a713-65d3f10b5555');
$targetsInvitationParticipantInfo1Identity->setUser($targetsInvitationParticipantInfo1IdentityUser);
$targetsInvitationParticipantInfo1->setIdentity($targetsInvitationParticipantInfo1Identity);
$targetsArray []= $targetsInvitationParticipantInfo1;
$targetsInvitationParticipantInfo2 = new ParticipantInfo();
$targetsInvitationParticipantInfo2->setOdataType('#microsoft.graph.participantInfo');
$targetsInvitationParticipantInfo2Identity = new IdentitySet();
$targetsInvitationParticipantInfo2Identity->setOdataType('#microsoft.graph.identitySet');
$targetsInvitationParticipantInfo2IdentityUser = new Identity();
$targetsInvitationParticipantInfo2IdentityUser->setOdataType('#microsoft.graph.identity');
$targetsInvitationParticipantInfo2IdentityUser->setDisplayName('user2');
$targetsInvitationParticipantInfo2IdentityUser->setId('bf5aae9a-d11d-47a8-93b1-782504c95555');
$targetsInvitationParticipantInfo2Identity->setUser($targetsInvitationParticipantInfo2IdentityUser);
$targetsInvitationParticipantInfo2->setIdentity($targetsInvitationParticipantInfo2Identity);
$targetsArray []= $targetsInvitationParticipantInfo2;
$requestBody->setTargets($targetsArray);
$requestBody->setRequestedModalities([new Modality('audio'),]);
$mediaConfig = new ServiceHostedMediaConfig();
$mediaConfig->setOdataType('#microsoft.graph.serviceHostedMediaConfig');
$mediaConfig->setRemoveFromDefaultAudioGroup(false);
$requestBody->setMediaConfig($mediaConfig);
$requestBody->setTenantId('aa67bd4c-8475-432d-bd41-39f255720e0a');
$result = $graphServiceClient->communications()->calls()->post($requestBody)->wait();
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.call import Call
from msgraph_beta.generated.models.call_direction import CallDirection
from msgraph_beta.generated.models.participant_info import ParticipantInfo
from msgraph_beta.generated.models.identity_set import IdentitySet
from msgraph_beta.generated.models.identity import Identity
from msgraph_beta.generated.models.invitation_participant_info import InvitationParticipantInfo
from msgraph_beta.generated.models.modality import Modality
from msgraph_beta.generated.models.service_hosted_media_config import ServiceHostedMediaConfig
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Call(
odata_type = "#microsoft.graph.call",
direction = CallDirection.Outgoing,
subject = "Create a group call with service hosted media",
callback_uri = "https://bot.contoso.com/callback",
source = ParticipantInfo(
odata_type = "#microsoft.graph.participantInfo",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
application = Identity(
odata_type = "#microsoft.graph.identity",
display_name = "TestBot",
id = "dd3885da-f9ab-486b-bfae-85de3d445555",
),
),
),
targets = [
InvitationParticipantInfo(
odata_type = "#microsoft.graph.invitationParticipantInfo",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
user = Identity(
odata_type = "#microsoft.graph.identity",
display_name = "user1",
id = "98da8a1a-1b87-452c-a713-65d3f10b5555",
),
),
),
ParticipantInfo(
odata_type = "#microsoft.graph.participantInfo",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
user = Identity(
odata_type = "#microsoft.graph.identity",
display_name = "user2",
id = "bf5aae9a-d11d-47a8-93b1-782504c95555",
),
),
),
],
requested_modalities = [
Modality.Audio,
],
media_config = ServiceHostedMediaConfig(
odata_type = "#microsoft.graph.serviceHostedMediaConfig",
remove_from_default_audio_group = False,
),
tenant_id = "aa67bd4c-8475-432d-bd41-39f255720e0a",
)
result = await graph_client.communications.calls.post(request_body)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Call
{
OdataType = "#microsoft.graph.call",
Direction = CallDirection.Outgoing,
Subject = "Create a group call with app hosted media",
CallbackUri = "https://bot.contoso.com/callback",
Source = new ParticipantInfo
{
OdataType = "#microsoft.graph.participantInfo",
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
Application = new Identity
{
OdataType = "#microsoft.graph.identity",
DisplayName = "TestBot",
Id = "dd3885da-f9ab-486b-bfae-85de3d445555",
},
},
},
Targets = new List<InvitationParticipantInfo>
{
new InvitationParticipantInfo
{
OdataType = "#microsoft.graph.invitationParticipantInfo",
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
User = new Identity
{
OdataType = "#microsoft.graph.identity",
DisplayName = "user1",
Id = "98da8a1a-1b87-452c-a713-65d3f10b5555",
},
},
},
new ParticipantInfo
{
OdataType = "#microsoft.graph.participantInfo",
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
User = new Identity
{
OdataType = "#microsoft.graph.identity",
DisplayName = "user2",
Id = "bf5aae9a-d11d-47a8-93b1-782504c95555",
},
},
},
},
RequestedModalities = new List<Modality?>
{
Modality.Audio,
},
MediaConfig = new AppHostedMediaConfig
{
OdataType = "#microsoft.graph.appHostedMediaConfig",
Blob = "<Media Session Configuration>",
RemoveFromDefaultAudioGroup = false,
},
TenantId = "aa67bd4c-8475-432d-bd41-39f255720e0a",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Communications.Calls.PostAsync(requestBody);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// 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"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewCall()
direction := graphmodels.OUTGOING_CALLDIRECTION
requestBody.SetDirection(&direction)
subject := "Create a group call with app hosted media"
requestBody.SetSubject(&subject)
callbackUri := "https://bot.contoso.com/callback"
requestBody.SetCallbackUri(&callbackUri)
source := graphmodels.NewParticipantInfo()
identity := graphmodels.NewIdentitySet()
application := graphmodels.NewIdentity()
displayName := "TestBot"
application.SetDisplayName(&displayName)
id := "dd3885da-f9ab-486b-bfae-85de3d445555"
application.SetId(&id)
identity.SetApplication(application)
source.SetIdentity(identity)
requestBody.SetSource(source)
invitationParticipantInfo := graphmodels.NewInvitationParticipantInfo()
identity := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
displayName := "user1"
user.SetDisplayName(&displayName)
id := "98da8a1a-1b87-452c-a713-65d3f10b5555"
user.SetId(&id)
identity.SetUser(user)
invitationParticipantInfo.SetIdentity(identity)
invitationParticipantInfo1 := graphmodels.NewParticipantInfo()
identity := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
displayName := "user2"
user.SetDisplayName(&displayName)
id := "bf5aae9a-d11d-47a8-93b1-782504c95555"
user.SetId(&id)
identity.SetUser(user)
invitationParticipantInfo1.SetIdentity(identity)
targets := []graphmodels.InvitationParticipantInfoable {
invitationParticipantInfo,
invitationParticipantInfo1,
}
requestBody.SetTargets(targets)
requestedModalities := []graphmodels.Modalityable {
modality := graphmodels.AUDIO_MODALITY
requestBody.SetModality(&modality)
}
requestBody.SetRequestedModalities(requestedModalities)
mediaConfig := graphmodels.NewAppHostedMediaConfig()
blob := "<Media Session Configuration>"
mediaConfig.SetBlob(&blob)
removeFromDefaultAudioGroup := false
mediaConfig.SetRemoveFromDefaultAudioGroup(&removeFromDefaultAudioGroup)
requestBody.SetMediaConfig(mediaConfig)
tenantId := "aa67bd4c-8475-432d-bd41-39f255720e0a"
requestBody.SetTenantId(&tenantId)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
calls, err := graphClient.Communications().Calls().Post(context.Background(), requestBody, nil)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Call call = new Call();
call.setOdataType("#microsoft.graph.call");
call.setDirection(CallDirection.Outgoing);
call.setSubject("Create a group call with app hosted media");
call.setCallbackUri("https://bot.contoso.com/callback");
ParticipantInfo source = new ParticipantInfo();
source.setOdataType("#microsoft.graph.participantInfo");
IdentitySet identity = new IdentitySet();
identity.setOdataType("#microsoft.graph.identitySet");
Identity application = new Identity();
application.setOdataType("#microsoft.graph.identity");
application.setDisplayName("TestBot");
application.setId("dd3885da-f9ab-486b-bfae-85de3d445555");
identity.setApplication(application);
source.setIdentity(identity);
call.setSource(source);
LinkedList<InvitationParticipantInfo> targets = new LinkedList<InvitationParticipantInfo>();
InvitationParticipantInfo invitationParticipantInfo = new InvitationParticipantInfo();
invitationParticipantInfo.setOdataType("#microsoft.graph.invitationParticipantInfo");
IdentitySet identity1 = new IdentitySet();
identity1.setOdataType("#microsoft.graph.identitySet");
Identity user = new Identity();
user.setOdataType("#microsoft.graph.identity");
user.setDisplayName("user1");
user.setId("98da8a1a-1b87-452c-a713-65d3f10b5555");
identity1.setUser(user);
invitationParticipantInfo.setIdentity(identity1);
targets.add(invitationParticipantInfo);
ParticipantInfo invitationParticipantInfo1 = new ParticipantInfo();
invitationParticipantInfo1.setOdataType("#microsoft.graph.participantInfo");
IdentitySet identity2 = new IdentitySet();
identity2.setOdataType("#microsoft.graph.identitySet");
Identity user1 = new Identity();
user1.setOdataType("#microsoft.graph.identity");
user1.setDisplayName("user2");
user1.setId("bf5aae9a-d11d-47a8-93b1-782504c95555");
identity2.setUser(user1);
invitationParticipantInfo1.setIdentity(identity2);
targets.add(invitationParticipantInfo1);
call.setTargets(targets);
LinkedList<Modality> requestedModalities = new LinkedList<Modality>();
requestedModalities.add(Modality.Audio);
call.setRequestedModalities(requestedModalities);
AppHostedMediaConfig mediaConfig = new AppHostedMediaConfig();
mediaConfig.setOdataType("#microsoft.graph.appHostedMediaConfig");
mediaConfig.setBlob("<Media Session Configuration>");
mediaConfig.setRemoveFromDefaultAudioGroup(false);
call.setMediaConfig(mediaConfig);
call.setTenantId("aa67bd4c-8475-432d-bd41-39f255720e0a");
Call result = graphClient.communications().calls().post(call);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Call;
use Microsoft\Graph\Beta\Generated\Models\CallDirection;
use Microsoft\Graph\Beta\Generated\Models\ParticipantInfo;
use Microsoft\Graph\Beta\Generated\Models\IdentitySet;
use Microsoft\Graph\Beta\Generated\Models\Identity;
use Microsoft\Graph\Beta\Generated\Models\InvitationParticipantInfo;
use Microsoft\Graph\Beta\Generated\Models\Modality;
use Microsoft\Graph\Beta\Generated\Models\AppHostedMediaConfig;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Call();
$requestBody->setOdataType('#microsoft.graph.call');
$requestBody->setDirection(new CallDirection('outgoing'));
$requestBody->setSubject('Create a group call with app hosted media');
$requestBody->setCallbackUri('https://bot.contoso.com/callback');
$source = new ParticipantInfo();
$source->setOdataType('#microsoft.graph.participantInfo');
$sourceIdentity = new IdentitySet();
$sourceIdentity->setOdataType('#microsoft.graph.identitySet');
$sourceIdentityApplication = new Identity();
$sourceIdentityApplication->setOdataType('#microsoft.graph.identity');
$sourceIdentityApplication->setDisplayName('TestBot');
$sourceIdentityApplication->setId('dd3885da-f9ab-486b-bfae-85de3d445555');
$sourceIdentity->setApplication($sourceIdentityApplication);
$source->setIdentity($sourceIdentity);
$requestBody->setSource($source);
$targetsInvitationParticipantInfo1 = new InvitationParticipantInfo();
$targetsInvitationParticipantInfo1->setOdataType('#microsoft.graph.invitationParticipantInfo');
$targetsInvitationParticipantInfo1Identity = new IdentitySet();
$targetsInvitationParticipantInfo1Identity->setOdataType('#microsoft.graph.identitySet');
$targetsInvitationParticipantInfo1IdentityUser = new Identity();
$targetsInvitationParticipantInfo1IdentityUser->setOdataType('#microsoft.graph.identity');
$targetsInvitationParticipantInfo1IdentityUser->setDisplayName('user1');
$targetsInvitationParticipantInfo1IdentityUser->setId('98da8a1a-1b87-452c-a713-65d3f10b5555');
$targetsInvitationParticipantInfo1Identity->setUser($targetsInvitationParticipantInfo1IdentityUser);
$targetsInvitationParticipantInfo1->setIdentity($targetsInvitationParticipantInfo1Identity);
$targetsArray []= $targetsInvitationParticipantInfo1;
$targetsInvitationParticipantInfo2 = new ParticipantInfo();
$targetsInvitationParticipantInfo2->setOdataType('#microsoft.graph.participantInfo');
$targetsInvitationParticipantInfo2Identity = new IdentitySet();
$targetsInvitationParticipantInfo2Identity->setOdataType('#microsoft.graph.identitySet');
$targetsInvitationParticipantInfo2IdentityUser = new Identity();
$targetsInvitationParticipantInfo2IdentityUser->setOdataType('#microsoft.graph.identity');
$targetsInvitationParticipantInfo2IdentityUser->setDisplayName('user2');
$targetsInvitationParticipantInfo2IdentityUser->setId('bf5aae9a-d11d-47a8-93b1-782504c95555');
$targetsInvitationParticipantInfo2Identity->setUser($targetsInvitationParticipantInfo2IdentityUser);
$targetsInvitationParticipantInfo2->setIdentity($targetsInvitationParticipantInfo2Identity);
$targetsArray []= $targetsInvitationParticipantInfo2;
$requestBody->setTargets($targetsArray);
$requestBody->setRequestedModalities([new Modality('audio'),]);
$mediaConfig = new AppHostedMediaConfig();
$mediaConfig->setOdataType('#microsoft.graph.appHostedMediaConfig');
$mediaConfig->setBlob('<Media Session Configuration>');
$mediaConfig->setRemoveFromDefaultAudioGroup(false);
$requestBody->setMediaConfig($mediaConfig);
$requestBody->setTenantId('aa67bd4c-8475-432d-bd41-39f255720e0a');
$result = $graphServiceClient->communications()->calls()->post($requestBody)->wait();
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.call import Call
from msgraph_beta.generated.models.call_direction import CallDirection
from msgraph_beta.generated.models.participant_info import ParticipantInfo
from msgraph_beta.generated.models.identity_set import IdentitySet
from msgraph_beta.generated.models.identity import Identity
from msgraph_beta.generated.models.invitation_participant_info import InvitationParticipantInfo
from msgraph_beta.generated.models.modality import Modality
from msgraph_beta.generated.models.app_hosted_media_config import AppHostedMediaConfig
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Call(
odata_type = "#microsoft.graph.call",
direction = CallDirection.Outgoing,
subject = "Create a group call with app hosted media",
callback_uri = "https://bot.contoso.com/callback",
source = ParticipantInfo(
odata_type = "#microsoft.graph.participantInfo",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
application = Identity(
odata_type = "#microsoft.graph.identity",
display_name = "TestBot",
id = "dd3885da-f9ab-486b-bfae-85de3d445555",
),
),
),
targets = [
InvitationParticipantInfo(
odata_type = "#microsoft.graph.invitationParticipantInfo",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
user = Identity(
odata_type = "#microsoft.graph.identity",
display_name = "user1",
id = "98da8a1a-1b87-452c-a713-65d3f10b5555",
),
),
),
ParticipantInfo(
odata_type = "#microsoft.graph.participantInfo",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
user = Identity(
odata_type = "#microsoft.graph.identity",
display_name = "user2",
id = "bf5aae9a-d11d-47a8-93b1-782504c95555",
),
),
),
],
requested_modalities = [
Modality.Audio,
],
media_config = AppHostedMediaConfig(
odata_type = "#microsoft.graph.appHostedMediaConfig",
blob = "<Media Session Configuration>",
remove_from_default_audio_group = False,
),
tenant_id = "aa67bd4c-8475-432d-bd41-39f255720e0a",
)
result = await graph_client.communications.calls.post(request_body)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Exemplo 5: Participar numa reunião agendada com suportes de dados alojados no serviço
Para participar na reunião agendada, tem de obter o ID do tópico, o ID da mensagem, o ID do organizador e o ID do inquilino no qual a reunião está agendada.
Estas informações podem ser obtidas a partir da API Get onlineMeeting .
Os valores de token de autorização, URL de chamada de retorno, ID da aplicação, nome da aplicação, ID de utilizador, nome de utilizador e ID de inquilino têm de ser substituídos juntamente com os detalhes obtidos a partir da API Get onlineMeeting com valores reais para que o exemplo funcione.
Nota: Este exemplo precisa da Calls.JoinGroupCalls.All permissão ou da permissão específica doCalls.JoinGroupCalls.Chat recurso.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Call
{
OdataType = "#microsoft.graph.call",
CallbackUri = "https://bot.contoso.com/callback",
RequestedModalities = new List<Modality?>
{
Modality.Audio,
},
MediaConfig = new ServiceHostedMediaConfig
{
OdataType = "#microsoft.graph.serviceHostedMediaConfig",
PreFetchMedia = new List<MediaInfo>
{
new MediaInfo
{
Uri = "https://cdn.contoso.com/beep.wav",
ResourceId = "f8971b04-b53e-418c-9222-c82ce681a582",
},
new MediaInfo
{
Uri = "https://cdn.contoso.com/cool.wav",
ResourceId = "86dc814b-c172-4428-9112-60f8ecae1edb",
},
},
},
ChatInfo = new ChatInfo
{
OdataType = "#microsoft.graph.chatInfo",
ThreadId = "19:meeting_Win6Ydo4wsMijFjZS00ZGVjLTk5MGUtOTRjNWY2NmNkYTFm@thread.v2",
MessageId = "0",
},
MeetingInfo = new OrganizerMeetingInfo
{
OdataType = "#microsoft.graph.organizerMeetingInfo",
Organizer = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
User = new Identity
{
OdataType = "#microsoft.graph.identity",
Id = "5810cede-f3cc-42eb-b2c1-e9bd5d53ec96",
DisplayName = "Bob",
AdditionalData = new Dictionary<string, object>
{
{
"tenantId" , "9f386a15-f9cc-445b-8106-ac85e314a07b"
},
},
},
},
AllowConversationWithoutHost = true,
},
TenantId = "86dc81db-c112-4228-9222-63f3esaa1edb",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Communications.Calls.PostAsync(requestBody);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// 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"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewCall()
callbackUri := "https://bot.contoso.com/callback"
requestBody.SetCallbackUri(&callbackUri)
requestedModalities := []graphmodels.Modalityable {
modality := graphmodels.AUDIO_MODALITY
requestBody.SetModality(&modality)
}
requestBody.SetRequestedModalities(requestedModalities)
mediaConfig := graphmodels.NewServiceHostedMediaConfig()
mediaInfo := graphmodels.NewMediaInfo()
uri := "https://cdn.contoso.com/beep.wav"
mediaInfo.SetUri(&uri)
resourceId := "f8971b04-b53e-418c-9222-c82ce681a582"
mediaInfo.SetResourceId(&resourceId)
mediaInfo1 := graphmodels.NewMediaInfo()
uri := "https://cdn.contoso.com/cool.wav"
mediaInfo1.SetUri(&uri)
resourceId := "86dc814b-c172-4428-9112-60f8ecae1edb"
mediaInfo1.SetResourceId(&resourceId)
preFetchMedia := []graphmodels.MediaInfoable {
mediaInfo,
mediaInfo1,
}
mediaConfig.SetPreFetchMedia(preFetchMedia)
requestBody.SetMediaConfig(mediaConfig)
chatInfo := graphmodels.NewChatInfo()
threadId := "19:meeting_Win6Ydo4wsMijFjZS00ZGVjLTk5MGUtOTRjNWY2NmNkYTFm@thread.v2"
chatInfo.SetThreadId(&threadId)
messageId := "0"
chatInfo.SetMessageId(&messageId)
requestBody.SetChatInfo(chatInfo)
meetingInfo := graphmodels.NewOrganizerMeetingInfo()
organizer := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
id := "5810cede-f3cc-42eb-b2c1-e9bd5d53ec96"
user.SetId(&id)
displayName := "Bob"
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"tenantId" : "9f386a15-f9cc-445b-8106-ac85e314a07b",
}
user.SetAdditionalData(additionalData)
organizer.SetUser(user)
meetingInfo.SetOrganizer(organizer)
allowConversationWithoutHost := true
meetingInfo.SetAllowConversationWithoutHost(&allowConversationWithoutHost)
requestBody.SetMeetingInfo(meetingInfo)
tenantId := "86dc81db-c112-4228-9222-63f3esaa1edb"
requestBody.SetTenantId(&tenantId)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
calls, err := graphClient.Communications().Calls().Post(context.Background(), requestBody, nil)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Call call = new Call();
call.setOdataType("#microsoft.graph.call");
call.setCallbackUri("https://bot.contoso.com/callback");
LinkedList<Modality> requestedModalities = new LinkedList<Modality>();
requestedModalities.add(Modality.Audio);
call.setRequestedModalities(requestedModalities);
ServiceHostedMediaConfig mediaConfig = new ServiceHostedMediaConfig();
mediaConfig.setOdataType("#microsoft.graph.serviceHostedMediaConfig");
LinkedList<MediaInfo> preFetchMedia = new LinkedList<MediaInfo>();
MediaInfo mediaInfo = new MediaInfo();
mediaInfo.setUri("https://cdn.contoso.com/beep.wav");
mediaInfo.setResourceId("f8971b04-b53e-418c-9222-c82ce681a582");
preFetchMedia.add(mediaInfo);
MediaInfo mediaInfo1 = new MediaInfo();
mediaInfo1.setUri("https://cdn.contoso.com/cool.wav");
mediaInfo1.setResourceId("86dc814b-c172-4428-9112-60f8ecae1edb");
preFetchMedia.add(mediaInfo1);
mediaConfig.setPreFetchMedia(preFetchMedia);
call.setMediaConfig(mediaConfig);
ChatInfo chatInfo = new ChatInfo();
chatInfo.setOdataType("#microsoft.graph.chatInfo");
chatInfo.setThreadId("19:meeting_Win6Ydo4wsMijFjZS00ZGVjLTk5MGUtOTRjNWY2NmNkYTFm@thread.v2");
chatInfo.setMessageId("0");
call.setChatInfo(chatInfo);
OrganizerMeetingInfo meetingInfo = new OrganizerMeetingInfo();
meetingInfo.setOdataType("#microsoft.graph.organizerMeetingInfo");
IdentitySet organizer = new IdentitySet();
organizer.setOdataType("#microsoft.graph.identitySet");
Identity user = new Identity();
user.setOdataType("#microsoft.graph.identity");
user.setId("5810cede-f3cc-42eb-b2c1-e9bd5d53ec96");
user.setDisplayName("Bob");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("tenantId", "9f386a15-f9cc-445b-8106-ac85e314a07b");
user.setAdditionalData(additionalData);
organizer.setUser(user);
meetingInfo.setOrganizer(organizer);
meetingInfo.setAllowConversationWithoutHost(true);
call.setMeetingInfo(meetingInfo);
call.setTenantId("86dc81db-c112-4228-9222-63f3esaa1edb");
Call result = graphClient.communications().calls().post(call);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Call;
use Microsoft\Graph\Beta\Generated\Models\Modality;
use Microsoft\Graph\Beta\Generated\Models\ServiceHostedMediaConfig;
use Microsoft\Graph\Beta\Generated\Models\MediaInfo;
use Microsoft\Graph\Beta\Generated\Models\ChatInfo;
use Microsoft\Graph\Beta\Generated\Models\OrganizerMeetingInfo;
use Microsoft\Graph\Beta\Generated\Models\IdentitySet;
use Microsoft\Graph\Beta\Generated\Models\Identity;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Call();
$requestBody->setOdataType('#microsoft.graph.call');
$requestBody->setCallbackUri('https://bot.contoso.com/callback');
$requestBody->setRequestedModalities([new Modality('audio'), ]);
$mediaConfig = new ServiceHostedMediaConfig();
$mediaConfig->setOdataType('#microsoft.graph.serviceHostedMediaConfig');
$preFetchMediaMediaInfo1 = new MediaInfo();
$preFetchMediaMediaInfo1->setUri('https://cdn.contoso.com/beep.wav');
$preFetchMediaMediaInfo1->setResourceId('f8971b04-b53e-418c-9222-c82ce681a582');
$preFetchMediaArray []= $preFetchMediaMediaInfo1;
$preFetchMediaMediaInfo2 = new MediaInfo();
$preFetchMediaMediaInfo2->setUri('https://cdn.contoso.com/cool.wav');
$preFetchMediaMediaInfo2->setResourceId('86dc814b-c172-4428-9112-60f8ecae1edb');
$preFetchMediaArray []= $preFetchMediaMediaInfo2;
$mediaConfig->setPreFetchMedia($preFetchMediaArray);
$requestBody->setMediaConfig($mediaConfig);
$chatInfo = new ChatInfo();
$chatInfo->setOdataType('#microsoft.graph.chatInfo');
$chatInfo->setThreadId('19:meeting_Win6Ydo4wsMijFjZS00ZGVjLTk5MGUtOTRjNWY2NmNkYTFm@thread.v2');
$chatInfo->setMessageId('0');
$requestBody->setChatInfo($chatInfo);
$meetingInfo = new OrganizerMeetingInfo();
$meetingInfo->setOdataType('#microsoft.graph.organizerMeetingInfo');
$meetingInfoOrganizer = new IdentitySet();
$meetingInfoOrganizer->setOdataType('#microsoft.graph.identitySet');
$meetingInfoOrganizerUser = new Identity();
$meetingInfoOrganizerUser->setOdataType('#microsoft.graph.identity');
$meetingInfoOrganizerUser->setId('5810cede-f3cc-42eb-b2c1-e9bd5d53ec96');
$meetingInfoOrganizerUser->setDisplayName('Bob');
$additionalData = [
'tenantId' => '9f386a15-f9cc-445b-8106-ac85e314a07b',
];
$meetingInfoOrganizerUser->setAdditionalData($additionalData);
$meetingInfoOrganizer->setUser($meetingInfoOrganizerUser);
$meetingInfo->setOrganizer($meetingInfoOrganizer);
$meetingInfo->setAllowConversationWithoutHost(true);
$requestBody->setMeetingInfo($meetingInfo);
$requestBody->setTenantId('86dc81db-c112-4228-9222-63f3esaa1edb');
$result = $graphServiceClient->communications()->calls()->post($requestBody)->wait();
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.call import Call
from msgraph_beta.generated.models.modality import Modality
from msgraph_beta.generated.models.service_hosted_media_config import ServiceHostedMediaConfig
from msgraph_beta.generated.models.media_info import MediaInfo
from msgraph_beta.generated.models.chat_info import ChatInfo
from msgraph_beta.generated.models.organizer_meeting_info import OrganizerMeetingInfo
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 = Call(
odata_type = "#microsoft.graph.call",
callback_uri = "https://bot.contoso.com/callback",
requested_modalities = [
Modality.Audio,
],
media_config = ServiceHostedMediaConfig(
odata_type = "#microsoft.graph.serviceHostedMediaConfig",
pre_fetch_media = [
MediaInfo(
uri = "https://cdn.contoso.com/beep.wav",
resource_id = "f8971b04-b53e-418c-9222-c82ce681a582",
),
MediaInfo(
uri = "https://cdn.contoso.com/cool.wav",
resource_id = "86dc814b-c172-4428-9112-60f8ecae1edb",
),
],
),
chat_info = ChatInfo(
odata_type = "#microsoft.graph.chatInfo",
thread_id = "19:meeting_Win6Ydo4wsMijFjZS00ZGVjLTk5MGUtOTRjNWY2NmNkYTFm@thread.v2",
message_id = "0",
),
meeting_info = OrganizerMeetingInfo(
odata_type = "#microsoft.graph.organizerMeetingInfo",
organizer = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
user = Identity(
odata_type = "#microsoft.graph.identity",
id = "5810cede-f3cc-42eb-b2c1-e9bd5d53ec96",
display_name = "Bob",
additional_data = {
"tenant_id" : "9f386a15-f9cc-445b-8106-ac85e314a07b",
}
),
),
allow_conversation_without_host = True,
),
tenant_id = "86dc81db-c112-4228-9222-63f3esaa1edb",
)
result = await graph_client.communications.calls.post(request_body)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Nota: Para cenários de reunião para além das notificações de estado de chamada, recebemos notificações de lista.
Exemplo 6: participar numa reunião agendada com joinMeetingId e código de acesso
O exemplo seguinte requer um joinMeetingId e um código de acesso para participar numa reunião existente. Pode obter estas propriedades a partir da API Get onlineMeeting .
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Call
{
OdataType = "#microsoft.graph.call",
CallbackUri = "https://bot.contoso.com/callback",
RequestedModalities = new List<Modality?>
{
Modality.Audio,
},
MediaConfig = new ServiceHostedMediaConfig
{
OdataType = "#microsoft.graph.serviceHostedMediaConfig",
PreFetchMedia = new List<MediaInfo>
{
new MediaInfo
{
Uri = "https://cdn.contoso.com/beep.wav",
ResourceId = "f8971b04-b53e-418c-9222-c82ce681a582",
},
new MediaInfo
{
Uri = "https://cdn.contoso.com/cool.wav",
ResourceId = "86dc814b-c172-4428-9112-60f8ecae1edb",
},
},
},
MeetingInfo = new JoinMeetingIdMeetingInfo
{
OdataType = "#microsoft.graph.joinMeetingIdMeetingInfo",
JoinMeetingId = "1234567",
Passcode = "psw123",
},
TenantId = "86dc81db-c112-4228-9222-63f3esaa1edb",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Communications.Calls.PostAsync(requestBody);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// 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"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewCall()
callbackUri := "https://bot.contoso.com/callback"
requestBody.SetCallbackUri(&callbackUri)
requestedModalities := []graphmodels.Modalityable {
modality := graphmodels.AUDIO_MODALITY
requestBody.SetModality(&modality)
}
requestBody.SetRequestedModalities(requestedModalities)
mediaConfig := graphmodels.NewServiceHostedMediaConfig()
mediaInfo := graphmodels.NewMediaInfo()
uri := "https://cdn.contoso.com/beep.wav"
mediaInfo.SetUri(&uri)
resourceId := "f8971b04-b53e-418c-9222-c82ce681a582"
mediaInfo.SetResourceId(&resourceId)
mediaInfo1 := graphmodels.NewMediaInfo()
uri := "https://cdn.contoso.com/cool.wav"
mediaInfo1.SetUri(&uri)
resourceId := "86dc814b-c172-4428-9112-60f8ecae1edb"
mediaInfo1.SetResourceId(&resourceId)
preFetchMedia := []graphmodels.MediaInfoable {
mediaInfo,
mediaInfo1,
}
mediaConfig.SetPreFetchMedia(preFetchMedia)
requestBody.SetMediaConfig(mediaConfig)
meetingInfo := graphmodels.NewJoinMeetingIdMeetingInfo()
joinMeetingId := "1234567"
meetingInfo.SetJoinMeetingId(&joinMeetingId)
passcode := "psw123"
meetingInfo.SetPasscode(&passcode)
requestBody.SetMeetingInfo(meetingInfo)
tenantId := "86dc81db-c112-4228-9222-63f3esaa1edb"
requestBody.SetTenantId(&tenantId)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
calls, err := graphClient.Communications().Calls().Post(context.Background(), requestBody, nil)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Call call = new Call();
call.setOdataType("#microsoft.graph.call");
call.setCallbackUri("https://bot.contoso.com/callback");
LinkedList<Modality> requestedModalities = new LinkedList<Modality>();
requestedModalities.add(Modality.Audio);
call.setRequestedModalities(requestedModalities);
ServiceHostedMediaConfig mediaConfig = new ServiceHostedMediaConfig();
mediaConfig.setOdataType("#microsoft.graph.serviceHostedMediaConfig");
LinkedList<MediaInfo> preFetchMedia = new LinkedList<MediaInfo>();
MediaInfo mediaInfo = new MediaInfo();
mediaInfo.setUri("https://cdn.contoso.com/beep.wav");
mediaInfo.setResourceId("f8971b04-b53e-418c-9222-c82ce681a582");
preFetchMedia.add(mediaInfo);
MediaInfo mediaInfo1 = new MediaInfo();
mediaInfo1.setUri("https://cdn.contoso.com/cool.wav");
mediaInfo1.setResourceId("86dc814b-c172-4428-9112-60f8ecae1edb");
preFetchMedia.add(mediaInfo1);
mediaConfig.setPreFetchMedia(preFetchMedia);
call.setMediaConfig(mediaConfig);
JoinMeetingIdMeetingInfo meetingInfo = new JoinMeetingIdMeetingInfo();
meetingInfo.setOdataType("#microsoft.graph.joinMeetingIdMeetingInfo");
meetingInfo.setJoinMeetingId("1234567");
meetingInfo.setPasscode("psw123");
call.setMeetingInfo(meetingInfo);
call.setTenantId("86dc81db-c112-4228-9222-63f3esaa1edb");
Call result = graphClient.communications().calls().post(call);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Call;
use Microsoft\Graph\Beta\Generated\Models\Modality;
use Microsoft\Graph\Beta\Generated\Models\ServiceHostedMediaConfig;
use Microsoft\Graph\Beta\Generated\Models\MediaInfo;
use Microsoft\Graph\Beta\Generated\Models\JoinMeetingIdMeetingInfo;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Call();
$requestBody->setOdataType('#microsoft.graph.call');
$requestBody->setCallbackUri('https://bot.contoso.com/callback');
$requestBody->setRequestedModalities([new Modality('audio'), ]);
$mediaConfig = new ServiceHostedMediaConfig();
$mediaConfig->setOdataType('#microsoft.graph.serviceHostedMediaConfig');
$preFetchMediaMediaInfo1 = new MediaInfo();
$preFetchMediaMediaInfo1->setUri('https://cdn.contoso.com/beep.wav');
$preFetchMediaMediaInfo1->setResourceId('f8971b04-b53e-418c-9222-c82ce681a582');
$preFetchMediaArray []= $preFetchMediaMediaInfo1;
$preFetchMediaMediaInfo2 = new MediaInfo();
$preFetchMediaMediaInfo2->setUri('https://cdn.contoso.com/cool.wav');
$preFetchMediaMediaInfo2->setResourceId('86dc814b-c172-4428-9112-60f8ecae1edb');
$preFetchMediaArray []= $preFetchMediaMediaInfo2;
$mediaConfig->setPreFetchMedia($preFetchMediaArray);
$requestBody->setMediaConfig($mediaConfig);
$meetingInfo = new JoinMeetingIdMeetingInfo();
$meetingInfo->setOdataType('#microsoft.graph.joinMeetingIdMeetingInfo');
$meetingInfo->setJoinMeetingId('1234567');
$meetingInfo->setPasscode('psw123');
$requestBody->setMeetingInfo($meetingInfo);
$requestBody->setTenantId('86dc81db-c112-4228-9222-63f3esaa1edb');
$result = $graphServiceClient->communications()->calls()->post($requestBody)->wait();
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.call import Call
from msgraph_beta.generated.models.modality import Modality
from msgraph_beta.generated.models.service_hosted_media_config import ServiceHostedMediaConfig
from msgraph_beta.generated.models.media_info import MediaInfo
from msgraph_beta.generated.models.join_meeting_id_meeting_info import JoinMeetingIdMeetingInfo
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Call(
odata_type = "#microsoft.graph.call",
callback_uri = "https://bot.contoso.com/callback",
requested_modalities = [
Modality.Audio,
],
media_config = ServiceHostedMediaConfig(
odata_type = "#microsoft.graph.serviceHostedMediaConfig",
pre_fetch_media = [
MediaInfo(
uri = "https://cdn.contoso.com/beep.wav",
resource_id = "f8971b04-b53e-418c-9222-c82ce681a582",
),
MediaInfo(
uri = "https://cdn.contoso.com/cool.wav",
resource_id = "86dc814b-c172-4428-9112-60f8ecae1edb",
),
],
),
meeting_info = JoinMeetingIdMeetingInfo(
odata_type = "#microsoft.graph.joinMeetingIdMeetingInfo",
join_meeting_id = "1234567",
passcode = "psw123",
),
tenant_id = "86dc81db-c112-4228-9222-63f3esaa1edb",
)
result = await graph_client.communications.calls.post(request_body)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Exemplo 7: Participar numa reunião agendada com joinMeetingId
O exemplo seguinte requer um joinMeetingId , mas não requer um código de acesso para participar numa reunião existente. Pode obter a propriedade joinMeetingId a partir da API Get onlineMeeting .
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Call
{
OdataType = "#microsoft.graph.call",
CallbackUri = "https://bot.contoso.com/callback",
RequestedModalities = new List<Modality?>
{
Modality.Audio,
},
MediaConfig = new ServiceHostedMediaConfig
{
OdataType = "#microsoft.graph.serviceHostedMediaConfig",
PreFetchMedia = new List<MediaInfo>
{
new MediaInfo
{
Uri = "https://cdn.contoso.com/beep.wav",
ResourceId = "f8971b04-b53e-418c-9222-c82ce681a582",
},
new MediaInfo
{
Uri = "https://cdn.contoso.com/cool.wav",
ResourceId = "86dc814b-c172-4428-9112-60f8ecae1edb",
},
},
},
MeetingInfo = new JoinMeetingIdMeetingInfo
{
OdataType = "#microsoft.graph.joinMeetingIdMeetingInfo",
JoinMeetingId = "1234567",
Passcode = null,
},
TenantId = "86dc81db-c112-4228-9222-63f3esaa1edb",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Communications.Calls.PostAsync(requestBody);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// 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"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewCall()
callbackUri := "https://bot.contoso.com/callback"
requestBody.SetCallbackUri(&callbackUri)
requestedModalities := []graphmodels.Modalityable {
modality := graphmodels.AUDIO_MODALITY
requestBody.SetModality(&modality)
}
requestBody.SetRequestedModalities(requestedModalities)
mediaConfig := graphmodels.NewServiceHostedMediaConfig()
mediaInfo := graphmodels.NewMediaInfo()
uri := "https://cdn.contoso.com/beep.wav"
mediaInfo.SetUri(&uri)
resourceId := "f8971b04-b53e-418c-9222-c82ce681a582"
mediaInfo.SetResourceId(&resourceId)
mediaInfo1 := graphmodels.NewMediaInfo()
uri := "https://cdn.contoso.com/cool.wav"
mediaInfo1.SetUri(&uri)
resourceId := "86dc814b-c172-4428-9112-60f8ecae1edb"
mediaInfo1.SetResourceId(&resourceId)
preFetchMedia := []graphmodels.MediaInfoable {
mediaInfo,
mediaInfo1,
}
mediaConfig.SetPreFetchMedia(preFetchMedia)
requestBody.SetMediaConfig(mediaConfig)
meetingInfo := graphmodels.NewJoinMeetingIdMeetingInfo()
joinMeetingId := "1234567"
meetingInfo.SetJoinMeetingId(&joinMeetingId)
passcode := null
meetingInfo.SetPasscode(&passcode)
requestBody.SetMeetingInfo(meetingInfo)
tenantId := "86dc81db-c112-4228-9222-63f3esaa1edb"
requestBody.SetTenantId(&tenantId)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
calls, err := graphClient.Communications().Calls().Post(context.Background(), requestBody, nil)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Call call = new Call();
call.setOdataType("#microsoft.graph.call");
call.setCallbackUri("https://bot.contoso.com/callback");
LinkedList<Modality> requestedModalities = new LinkedList<Modality>();
requestedModalities.add(Modality.Audio);
call.setRequestedModalities(requestedModalities);
ServiceHostedMediaConfig mediaConfig = new ServiceHostedMediaConfig();
mediaConfig.setOdataType("#microsoft.graph.serviceHostedMediaConfig");
LinkedList<MediaInfo> preFetchMedia = new LinkedList<MediaInfo>();
MediaInfo mediaInfo = new MediaInfo();
mediaInfo.setUri("https://cdn.contoso.com/beep.wav");
mediaInfo.setResourceId("f8971b04-b53e-418c-9222-c82ce681a582");
preFetchMedia.add(mediaInfo);
MediaInfo mediaInfo1 = new MediaInfo();
mediaInfo1.setUri("https://cdn.contoso.com/cool.wav");
mediaInfo1.setResourceId("86dc814b-c172-4428-9112-60f8ecae1edb");
preFetchMedia.add(mediaInfo1);
mediaConfig.setPreFetchMedia(preFetchMedia);
call.setMediaConfig(mediaConfig);
JoinMeetingIdMeetingInfo meetingInfo = new JoinMeetingIdMeetingInfo();
meetingInfo.setOdataType("#microsoft.graph.joinMeetingIdMeetingInfo");
meetingInfo.setJoinMeetingId("1234567");
meetingInfo.setPasscode(null);
call.setMeetingInfo(meetingInfo);
call.setTenantId("86dc81db-c112-4228-9222-63f3esaa1edb");
Call result = graphClient.communications().calls().post(call);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Call;
use Microsoft\Graph\Beta\Generated\Models\Modality;
use Microsoft\Graph\Beta\Generated\Models\ServiceHostedMediaConfig;
use Microsoft\Graph\Beta\Generated\Models\MediaInfo;
use Microsoft\Graph\Beta\Generated\Models\JoinMeetingIdMeetingInfo;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Call();
$requestBody->setOdataType('#microsoft.graph.call');
$requestBody->setCallbackUri('https://bot.contoso.com/callback');
$requestBody->setRequestedModalities([new Modality('audio'), ]);
$mediaConfig = new ServiceHostedMediaConfig();
$mediaConfig->setOdataType('#microsoft.graph.serviceHostedMediaConfig');
$preFetchMediaMediaInfo1 = new MediaInfo();
$preFetchMediaMediaInfo1->setUri('https://cdn.contoso.com/beep.wav');
$preFetchMediaMediaInfo1->setResourceId('f8971b04-b53e-418c-9222-c82ce681a582');
$preFetchMediaArray []= $preFetchMediaMediaInfo1;
$preFetchMediaMediaInfo2 = new MediaInfo();
$preFetchMediaMediaInfo2->setUri('https://cdn.contoso.com/cool.wav');
$preFetchMediaMediaInfo2->setResourceId('86dc814b-c172-4428-9112-60f8ecae1edb');
$preFetchMediaArray []= $preFetchMediaMediaInfo2;
$mediaConfig->setPreFetchMedia($preFetchMediaArray);
$requestBody->setMediaConfig($mediaConfig);
$meetingInfo = new JoinMeetingIdMeetingInfo();
$meetingInfo->setOdataType('#microsoft.graph.joinMeetingIdMeetingInfo');
$meetingInfo->setJoinMeetingId('1234567');
$meetingInfo->setPasscode(null);
$requestBody->setMeetingInfo($meetingInfo);
$requestBody->setTenantId('86dc81db-c112-4228-9222-63f3esaa1edb');
$result = $graphServiceClient->communications()->calls()->post($requestBody)->wait();
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.call import Call
from msgraph_beta.generated.models.modality import Modality
from msgraph_beta.generated.models.service_hosted_media_config import ServiceHostedMediaConfig
from msgraph_beta.generated.models.media_info import MediaInfo
from msgraph_beta.generated.models.join_meeting_id_meeting_info import JoinMeetingIdMeetingInfo
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Call(
odata_type = "#microsoft.graph.call",
callback_uri = "https://bot.contoso.com/callback",
requested_modalities = [
Modality.Audio,
],
media_config = ServiceHostedMediaConfig(
odata_type = "#microsoft.graph.serviceHostedMediaConfig",
pre_fetch_media = [
MediaInfo(
uri = "https://cdn.contoso.com/beep.wav",
resource_id = "f8971b04-b53e-418c-9222-c82ce681a582",
),
MediaInfo(
uri = "https://cdn.contoso.com/cool.wav",
resource_id = "86dc814b-c172-4428-9112-60f8ecae1edb",
),
],
),
meeting_info = JoinMeetingIdMeetingInfo(
odata_type = "#microsoft.graph.joinMeetingIdMeetingInfo",
join_meeting_id = "1234567",
passcode = None,
),
tenant_id = "86dc81db-c112-4228-9222-63f3esaa1edb",
)
result = await graph_client.communications.calls.post(request_body)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Exemplo 8: Participar numa reunião agendada com suportes de dados alojados na aplicação
Para participar na reunião com o suporte de dados alojado da aplicação, atualize a configuração de multimédia com appHostedMediaConfig , conforme mostrado no exemplo seguinte.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Call
{
OdataType = "#microsoft.graph.call",
Direction = CallDirection.Outgoing,
CallbackUri = "https://bot.contoso.com/callback",
RequestedModalities = new List<Modality?>
{
Modality.Audio,
},
MediaConfig = new AppHostedMediaConfig
{
OdataType = "#microsoft.graph.appHostedMediaConfig",
Blob = "<Media Session Configuration>",
},
ChatInfo = new ChatInfo
{
OdataType = "#microsoft.graph.chatInfo",
ThreadId = "19:meeting_Win6Ydo4wsMijFjZS00ZGVjLTk5MGUtOTRjNWY2NmNkYTFm@thread.v2",
MessageId = "0",
},
MeetingInfo = new OrganizerMeetingInfo
{
OdataType = "#microsoft.graph.organizerMeetingInfo",
Organizer = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
User = new Identity
{
OdataType = "#microsoft.graph.identity",
Id = "5810cede-f3cc-42eb-b2c1-e9bd5d53ec96",
DisplayName = "Bob",
AdditionalData = new Dictionary<string, object>
{
{
"tenantId" , "aa67bd4c-8475-432d-bd41-39f255720e0a"
},
},
},
},
AllowConversationWithoutHost = true,
},
TenantId = "aa67bd4c-8475-432d-bd41-39f255720e0a",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Communications.Calls.PostAsync(requestBody);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// 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"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewCall()
direction := graphmodels.OUTGOING_CALLDIRECTION
requestBody.SetDirection(&direction)
callbackUri := "https://bot.contoso.com/callback"
requestBody.SetCallbackUri(&callbackUri)
requestedModalities := []graphmodels.Modalityable {
modality := graphmodels.AUDIO_MODALITY
requestBody.SetModality(&modality)
}
requestBody.SetRequestedModalities(requestedModalities)
mediaConfig := graphmodels.NewAppHostedMediaConfig()
blob := "<Media Session Configuration>"
mediaConfig.SetBlob(&blob)
requestBody.SetMediaConfig(mediaConfig)
chatInfo := graphmodels.NewChatInfo()
threadId := "19:meeting_Win6Ydo4wsMijFjZS00ZGVjLTk5MGUtOTRjNWY2NmNkYTFm@thread.v2"
chatInfo.SetThreadId(&threadId)
messageId := "0"
chatInfo.SetMessageId(&messageId)
requestBody.SetChatInfo(chatInfo)
meetingInfo := graphmodels.NewOrganizerMeetingInfo()
organizer := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
id := "5810cede-f3cc-42eb-b2c1-e9bd5d53ec96"
user.SetId(&id)
displayName := "Bob"
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"tenantId" : "aa67bd4c-8475-432d-bd41-39f255720e0a",
}
user.SetAdditionalData(additionalData)
organizer.SetUser(user)
meetingInfo.SetOrganizer(organizer)
allowConversationWithoutHost := true
meetingInfo.SetAllowConversationWithoutHost(&allowConversationWithoutHost)
requestBody.SetMeetingInfo(meetingInfo)
tenantId := "aa67bd4c-8475-432d-bd41-39f255720e0a"
requestBody.SetTenantId(&tenantId)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
calls, err := graphClient.Communications().Calls().Post(context.Background(), requestBody, nil)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Call call = new Call();
call.setOdataType("#microsoft.graph.call");
call.setDirection(CallDirection.Outgoing);
call.setCallbackUri("https://bot.contoso.com/callback");
LinkedList<Modality> requestedModalities = new LinkedList<Modality>();
requestedModalities.add(Modality.Audio);
call.setRequestedModalities(requestedModalities);
AppHostedMediaConfig mediaConfig = new AppHostedMediaConfig();
mediaConfig.setOdataType("#microsoft.graph.appHostedMediaConfig");
mediaConfig.setBlob("<Media Session Configuration>");
call.setMediaConfig(mediaConfig);
ChatInfo chatInfo = new ChatInfo();
chatInfo.setOdataType("#microsoft.graph.chatInfo");
chatInfo.setThreadId("19:meeting_Win6Ydo4wsMijFjZS00ZGVjLTk5MGUtOTRjNWY2NmNkYTFm@thread.v2");
chatInfo.setMessageId("0");
call.setChatInfo(chatInfo);
OrganizerMeetingInfo meetingInfo = new OrganizerMeetingInfo();
meetingInfo.setOdataType("#microsoft.graph.organizerMeetingInfo");
IdentitySet organizer = new IdentitySet();
organizer.setOdataType("#microsoft.graph.identitySet");
Identity user = new Identity();
user.setOdataType("#microsoft.graph.identity");
user.setId("5810cede-f3cc-42eb-b2c1-e9bd5d53ec96");
user.setDisplayName("Bob");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("tenantId", "aa67bd4c-8475-432d-bd41-39f255720e0a");
user.setAdditionalData(additionalData);
organizer.setUser(user);
meetingInfo.setOrganizer(organizer);
meetingInfo.setAllowConversationWithoutHost(true);
call.setMeetingInfo(meetingInfo);
call.setTenantId("aa67bd4c-8475-432d-bd41-39f255720e0a");
Call result = graphClient.communications().calls().post(call);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Call;
use Microsoft\Graph\Beta\Generated\Models\CallDirection;
use Microsoft\Graph\Beta\Generated\Models\Modality;
use Microsoft\Graph\Beta\Generated\Models\AppHostedMediaConfig;
use Microsoft\Graph\Beta\Generated\Models\ChatInfo;
use Microsoft\Graph\Beta\Generated\Models\OrganizerMeetingInfo;
use Microsoft\Graph\Beta\Generated\Models\IdentitySet;
use Microsoft\Graph\Beta\Generated\Models\Identity;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Call();
$requestBody->setOdataType('#microsoft.graph.call');
$requestBody->setDirection(new CallDirection('outgoing'));
$requestBody->setCallbackUri('https://bot.contoso.com/callback');
$requestBody->setRequestedModalities([new Modality('audio'), ]);
$mediaConfig = new AppHostedMediaConfig();
$mediaConfig->setOdataType('#microsoft.graph.appHostedMediaConfig');
$mediaConfig->setBlob('<Media Session Configuration>');
$requestBody->setMediaConfig($mediaConfig);
$chatInfo = new ChatInfo();
$chatInfo->setOdataType('#microsoft.graph.chatInfo');
$chatInfo->setThreadId('19:meeting_Win6Ydo4wsMijFjZS00ZGVjLTk5MGUtOTRjNWY2NmNkYTFm@thread.v2');
$chatInfo->setMessageId('0');
$requestBody->setChatInfo($chatInfo);
$meetingInfo = new OrganizerMeetingInfo();
$meetingInfo->setOdataType('#microsoft.graph.organizerMeetingInfo');
$meetingInfoOrganizer = new IdentitySet();
$meetingInfoOrganizer->setOdataType('#microsoft.graph.identitySet');
$meetingInfoOrganizerUser = new Identity();
$meetingInfoOrganizerUser->setOdataType('#microsoft.graph.identity');
$meetingInfoOrganizerUser->setId('5810cede-f3cc-42eb-b2c1-e9bd5d53ec96');
$meetingInfoOrganizerUser->setDisplayName('Bob');
$additionalData = [
'tenantId' => 'aa67bd4c-8475-432d-bd41-39f255720e0a',
];
$meetingInfoOrganizerUser->setAdditionalData($additionalData);
$meetingInfoOrganizer->setUser($meetingInfoOrganizerUser);
$meetingInfo->setOrganizer($meetingInfoOrganizer);
$meetingInfo->setAllowConversationWithoutHost(true);
$requestBody->setMeetingInfo($meetingInfo);
$requestBody->setTenantId('aa67bd4c-8475-432d-bd41-39f255720e0a');
$result = $graphServiceClient->communications()->calls()->post($requestBody)->wait();
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.call import Call
from msgraph_beta.generated.models.call_direction import CallDirection
from msgraph_beta.generated.models.modality import Modality
from msgraph_beta.generated.models.app_hosted_media_config import AppHostedMediaConfig
from msgraph_beta.generated.models.chat_info import ChatInfo
from msgraph_beta.generated.models.organizer_meeting_info import OrganizerMeetingInfo
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 = Call(
odata_type = "#microsoft.graph.call",
direction = CallDirection.Outgoing,
callback_uri = "https://bot.contoso.com/callback",
requested_modalities = [
Modality.Audio,
],
media_config = AppHostedMediaConfig(
odata_type = "#microsoft.graph.appHostedMediaConfig",
blob = "<Media Session Configuration>",
),
chat_info = ChatInfo(
odata_type = "#microsoft.graph.chatInfo",
thread_id = "19:meeting_Win6Ydo4wsMijFjZS00ZGVjLTk5MGUtOTRjNWY2NmNkYTFm@thread.v2",
message_id = "0",
),
meeting_info = OrganizerMeetingInfo(
odata_type = "#microsoft.graph.organizerMeetingInfo",
organizer = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
user = Identity(
odata_type = "#microsoft.graph.identity",
id = "5810cede-f3cc-42eb-b2c1-e9bd5d53ec96",
display_name = "Bob",
additional_data = {
"tenant_id" : "aa67bd4c-8475-432d-bd41-39f255720e0a",
}
),
),
allow_conversation_without_host = True,
),
tenant_id = "aa67bd4c-8475-432d-bd41-39f255720e0a",
)
result = await graph_client.communications.calls.post(request_body)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Exemplo 9: Participar numa reunião de canal com suportes de dados alojados no serviço
A reunião dentro de um canal requer detalhes específicos, como o ID do tópico, o ID da mensagem e os detalhes do organizador que podem ser obtidos com a API Get onlineMeeting .
Os valores de token de autorização, URL de chamada de retorno, ID da aplicação, nome da aplicação, ID de utilizador, nome de utilizador e ID de inquilino têm de ser substituídos juntamente com os detalhes obtidos a partir da API Get onlineMeeting com valores reais para que o exemplo funcione.
Nota: Este exemplo precisa da Calls.JoinGroupCalls.All permissão.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Call
{
OdataType = "#microsoft.graph.call",
CallbackUri = "https://bot.contoso.com/callback",
RequestedModalities = new List<Modality?>
{
Modality.Audio,
},
MediaConfig = new ServiceHostedMediaConfig
{
OdataType = "#microsoft.graph.serviceHostedMediaConfig",
PreFetchMedia = new List<MediaInfo>
{
new MediaInfo
{
Uri = "https://cdn.contoso.com/beep.wav",
ResourceId = "f8971b04-b53e-418c-9222-c82ce681a582",
},
new MediaInfo
{
Uri = "https://cdn.contoso.com/cool.wav",
ResourceId = "86dc814b-c172-4428-9112-60f8ecae1edb",
},
},
},
ChatInfo = new ChatInfo
{
OdataType = "#microsoft.graph.chatInfo",
ThreadId = "19:cbee7c1c860e465f8258e3cebf7bee0d@thread.skype",
MessageId = "1533758867081",
},
MeetingInfo = new OrganizerMeetingInfo
{
OdataType = "#microsoft.graph.organizerMeetingInfo",
Organizer = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
User = new Identity
{
OdataType = "#microsoft.graph.identity",
Id = "5810cede-f3cc-42eb-b2c1-e9bd5d53ec96",
DisplayName = "Bob",
AdditionalData = new Dictionary<string, object>
{
{
"tenantId" , "aa67bd4c-8475-432d-bd41-39f255720e0a"
},
},
},
},
AllowConversationWithoutHost = true,
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Communications.Calls.PostAsync(requestBody);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// 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"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewCall()
callbackUri := "https://bot.contoso.com/callback"
requestBody.SetCallbackUri(&callbackUri)
requestedModalities := []graphmodels.Modalityable {
modality := graphmodels.AUDIO_MODALITY
requestBody.SetModality(&modality)
}
requestBody.SetRequestedModalities(requestedModalities)
mediaConfig := graphmodels.NewServiceHostedMediaConfig()
mediaInfo := graphmodels.NewMediaInfo()
uri := "https://cdn.contoso.com/beep.wav"
mediaInfo.SetUri(&uri)
resourceId := "f8971b04-b53e-418c-9222-c82ce681a582"
mediaInfo.SetResourceId(&resourceId)
mediaInfo1 := graphmodels.NewMediaInfo()
uri := "https://cdn.contoso.com/cool.wav"
mediaInfo1.SetUri(&uri)
resourceId := "86dc814b-c172-4428-9112-60f8ecae1edb"
mediaInfo1.SetResourceId(&resourceId)
preFetchMedia := []graphmodels.MediaInfoable {
mediaInfo,
mediaInfo1,
}
mediaConfig.SetPreFetchMedia(preFetchMedia)
requestBody.SetMediaConfig(mediaConfig)
chatInfo := graphmodels.NewChatInfo()
threadId := "19:cbee7c1c860e465f8258e3cebf7bee0d@thread.skype"
chatInfo.SetThreadId(&threadId)
messageId := "1533758867081"
chatInfo.SetMessageId(&messageId)
requestBody.SetChatInfo(chatInfo)
meetingInfo := graphmodels.NewOrganizerMeetingInfo()
organizer := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
id := "5810cede-f3cc-42eb-b2c1-e9bd5d53ec96"
user.SetId(&id)
displayName := "Bob"
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"tenantId" : "aa67bd4c-8475-432d-bd41-39f255720e0a",
}
user.SetAdditionalData(additionalData)
organizer.SetUser(user)
meetingInfo.SetOrganizer(organizer)
allowConversationWithoutHost := true
meetingInfo.SetAllowConversationWithoutHost(&allowConversationWithoutHost)
requestBody.SetMeetingInfo(meetingInfo)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
calls, err := graphClient.Communications().Calls().Post(context.Background(), requestBody, nil)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Call call = new Call();
call.setOdataType("#microsoft.graph.call");
call.setCallbackUri("https://bot.contoso.com/callback");
LinkedList<Modality> requestedModalities = new LinkedList<Modality>();
requestedModalities.add(Modality.Audio);
call.setRequestedModalities(requestedModalities);
ServiceHostedMediaConfig mediaConfig = new ServiceHostedMediaConfig();
mediaConfig.setOdataType("#microsoft.graph.serviceHostedMediaConfig");
LinkedList<MediaInfo> preFetchMedia = new LinkedList<MediaInfo>();
MediaInfo mediaInfo = new MediaInfo();
mediaInfo.setUri("https://cdn.contoso.com/beep.wav");
mediaInfo.setResourceId("f8971b04-b53e-418c-9222-c82ce681a582");
preFetchMedia.add(mediaInfo);
MediaInfo mediaInfo1 = new MediaInfo();
mediaInfo1.setUri("https://cdn.contoso.com/cool.wav");
mediaInfo1.setResourceId("86dc814b-c172-4428-9112-60f8ecae1edb");
preFetchMedia.add(mediaInfo1);
mediaConfig.setPreFetchMedia(preFetchMedia);
call.setMediaConfig(mediaConfig);
ChatInfo chatInfo = new ChatInfo();
chatInfo.setOdataType("#microsoft.graph.chatInfo");
chatInfo.setThreadId("19:cbee7c1c860e465f8258e3cebf7bee0d@thread.skype");
chatInfo.setMessageId("1533758867081");
call.setChatInfo(chatInfo);
OrganizerMeetingInfo meetingInfo = new OrganizerMeetingInfo();
meetingInfo.setOdataType("#microsoft.graph.organizerMeetingInfo");
IdentitySet organizer = new IdentitySet();
organizer.setOdataType("#microsoft.graph.identitySet");
Identity user = new Identity();
user.setOdataType("#microsoft.graph.identity");
user.setId("5810cede-f3cc-42eb-b2c1-e9bd5d53ec96");
user.setDisplayName("Bob");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("tenantId", "aa67bd4c-8475-432d-bd41-39f255720e0a");
user.setAdditionalData(additionalData);
organizer.setUser(user);
meetingInfo.setOrganizer(organizer);
meetingInfo.setAllowConversationWithoutHost(true);
call.setMeetingInfo(meetingInfo);
Call result = graphClient.communications().calls().post(call);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Call;
use Microsoft\Graph\Beta\Generated\Models\Modality;
use Microsoft\Graph\Beta\Generated\Models\ServiceHostedMediaConfig;
use Microsoft\Graph\Beta\Generated\Models\MediaInfo;
use Microsoft\Graph\Beta\Generated\Models\ChatInfo;
use Microsoft\Graph\Beta\Generated\Models\OrganizerMeetingInfo;
use Microsoft\Graph\Beta\Generated\Models\IdentitySet;
use Microsoft\Graph\Beta\Generated\Models\Identity;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Call();
$requestBody->setOdataType('#microsoft.graph.call');
$requestBody->setCallbackUri('https://bot.contoso.com/callback');
$requestBody->setRequestedModalities([new Modality('audio'), ]);
$mediaConfig = new ServiceHostedMediaConfig();
$mediaConfig->setOdataType('#microsoft.graph.serviceHostedMediaConfig');
$preFetchMediaMediaInfo1 = new MediaInfo();
$preFetchMediaMediaInfo1->setUri('https://cdn.contoso.com/beep.wav');
$preFetchMediaMediaInfo1->setResourceId('f8971b04-b53e-418c-9222-c82ce681a582');
$preFetchMediaArray []= $preFetchMediaMediaInfo1;
$preFetchMediaMediaInfo2 = new MediaInfo();
$preFetchMediaMediaInfo2->setUri('https://cdn.contoso.com/cool.wav');
$preFetchMediaMediaInfo2->setResourceId('86dc814b-c172-4428-9112-60f8ecae1edb');
$preFetchMediaArray []= $preFetchMediaMediaInfo2;
$mediaConfig->setPreFetchMedia($preFetchMediaArray);
$requestBody->setMediaConfig($mediaConfig);
$chatInfo = new ChatInfo();
$chatInfo->setOdataType('#microsoft.graph.chatInfo');
$chatInfo->setThreadId('19:cbee7c1c860e465f8258e3cebf7bee0d@thread.skype');
$chatInfo->setMessageId('1533758867081');
$requestBody->setChatInfo($chatInfo);
$meetingInfo = new OrganizerMeetingInfo();
$meetingInfo->setOdataType('#microsoft.graph.organizerMeetingInfo');
$meetingInfoOrganizer = new IdentitySet();
$meetingInfoOrganizer->setOdataType('#microsoft.graph.identitySet');
$meetingInfoOrganizerUser = new Identity();
$meetingInfoOrganizerUser->setOdataType('#microsoft.graph.identity');
$meetingInfoOrganizerUser->setId('5810cede-f3cc-42eb-b2c1-e9bd5d53ec96');
$meetingInfoOrganizerUser->setDisplayName('Bob');
$additionalData = [
'tenantId' => 'aa67bd4c-8475-432d-bd41-39f255720e0a',
];
$meetingInfoOrganizerUser->setAdditionalData($additionalData);
$meetingInfoOrganizer->setUser($meetingInfoOrganizerUser);
$meetingInfo->setOrganizer($meetingInfoOrganizer);
$meetingInfo->setAllowConversationWithoutHost(true);
$requestBody->setMeetingInfo($meetingInfo);
$result = $graphServiceClient->communications()->calls()->post($requestBody)->wait();
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.call import Call
from msgraph_beta.generated.models.modality import Modality
from msgraph_beta.generated.models.service_hosted_media_config import ServiceHostedMediaConfig
from msgraph_beta.generated.models.media_info import MediaInfo
from msgraph_beta.generated.models.chat_info import ChatInfo
from msgraph_beta.generated.models.organizer_meeting_info import OrganizerMeetingInfo
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 = Call(
odata_type = "#microsoft.graph.call",
callback_uri = "https://bot.contoso.com/callback",
requested_modalities = [
Modality.Audio,
],
media_config = ServiceHostedMediaConfig(
odata_type = "#microsoft.graph.serviceHostedMediaConfig",
pre_fetch_media = [
MediaInfo(
uri = "https://cdn.contoso.com/beep.wav",
resource_id = "f8971b04-b53e-418c-9222-c82ce681a582",
),
MediaInfo(
uri = "https://cdn.contoso.com/cool.wav",
resource_id = "86dc814b-c172-4428-9112-60f8ecae1edb",
),
],
),
chat_info = ChatInfo(
odata_type = "#microsoft.graph.chatInfo",
thread_id = "19:cbee7c1c860e465f8258e3cebf7bee0d@thread.skype",
message_id = "1533758867081",
),
meeting_info = OrganizerMeetingInfo(
odata_type = "#microsoft.graph.organizerMeetingInfo",
organizer = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
user = Identity(
odata_type = "#microsoft.graph.identity",
id = "5810cede-f3cc-42eb-b2c1-e9bd5d53ec96",
display_name = "Bob",
additional_data = {
"tenant_id" : "aa67bd4c-8475-432d-bd41-39f255720e0a",
}
),
),
allow_conversation_without_host = True,
),
)
result = await graph_client.communications.calls.post(request_body)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Exemplo 10: Participar numa reunião de canal como convidado com suportes de dados alojados no serviço
Para participar numa reunião de canal como convidado, tem de criar uma identidade de convidado e adicioná-la como a origem da chamada no pedido de reunião.
O nome a apresentar é o nome que pretende que seja apresentado na reunião para a sua identidade de convidado. O ID pode ser um ID exclusivo que identifica a identidade do convidado.
Nota: Este exemplo precisa da Calls.JoinGroupCallsAsGuest.All permissão.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Call
{
OdataType = "#microsoft.graph.call",
CallbackUri = "https://bot.contoso.com/callback",
Source = new ParticipantInfo
{
OdataType = "#microsoft.graph.participantInfo",
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
AdditionalData = new Dictionary<string, object>
{
{
"guest" , new Identity
{
OdataType = "#microsoft.graph.identity",
DisplayName = "Guest User",
Id = "d7a3b999-17ac-4bca-9e77-e6a730d2ec2e",
}
},
},
},
},
RequestedModalities = new List<Modality?>
{
Modality.Audio,
},
MediaConfig = new ServiceHostedMediaConfig
{
OdataType = "#microsoft.graph.serviceHostedMediaConfig",
PreFetchMedia = new List<MediaInfo>
{
new MediaInfo
{
Uri = "https://cdn.contoso.com/beep.wav",
ResourceId = "f8971b04-b53e-418c-9222-c82ce681a582",
},
new MediaInfo
{
Uri = "https://cdn.contoso.com/cool.wav",
ResourceId = "86dc814b-c172-4428-9112-60f8ecae1edb",
},
},
},
ChatInfo = new ChatInfo
{
OdataType = "#microsoft.graph.chatInfo",
ThreadId = "19:cbee7c1c860e465f8258e3cebf7bee0d@thread.skype",
MessageId = "1533758867081",
},
MeetingInfo = new OrganizerMeetingInfo
{
OdataType = "#microsoft.graph.organizerMeetingInfo",
Organizer = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
User = new Identity
{
OdataType = "#microsoft.graph.identity",
Id = "5810cede-f3cc-42eb-b2c1-e9bd5d53ec96",
DisplayName = "Bob",
AdditionalData = new Dictionary<string, object>
{
{
"tenantId" , "aa67bd4c-8475-432d-bd41-39f255720e0a"
},
},
},
},
AllowConversationWithoutHost = true,
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Communications.Calls.PostAsync(requestBody);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// 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"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewCall()
callbackUri := "https://bot.contoso.com/callback"
requestBody.SetCallbackUri(&callbackUri)
source := graphmodels.NewParticipantInfo()
identity := graphmodels.NewIdentitySet()
additionalData := map[string]interface{}{
guest := graphmodels.NewIdentity()
displayName := "Guest User"
guest.SetDisplayName(&displayName)
id := "d7a3b999-17ac-4bca-9e77-e6a730d2ec2e"
guest.SetId(&id)
identity.SetGuest(guest)
}
identity.SetAdditionalData(additionalData)
source.SetIdentity(identity)
requestBody.SetSource(source)
requestedModalities := []graphmodels.Modalityable {
modality := graphmodels.AUDIO_MODALITY
requestBody.SetModality(&modality)
}
requestBody.SetRequestedModalities(requestedModalities)
mediaConfig := graphmodels.NewServiceHostedMediaConfig()
mediaInfo := graphmodels.NewMediaInfo()
uri := "https://cdn.contoso.com/beep.wav"
mediaInfo.SetUri(&uri)
resourceId := "f8971b04-b53e-418c-9222-c82ce681a582"
mediaInfo.SetResourceId(&resourceId)
mediaInfo1 := graphmodels.NewMediaInfo()
uri := "https://cdn.contoso.com/cool.wav"
mediaInfo1.SetUri(&uri)
resourceId := "86dc814b-c172-4428-9112-60f8ecae1edb"
mediaInfo1.SetResourceId(&resourceId)
preFetchMedia := []graphmodels.MediaInfoable {
mediaInfo,
mediaInfo1,
}
mediaConfig.SetPreFetchMedia(preFetchMedia)
requestBody.SetMediaConfig(mediaConfig)
chatInfo := graphmodels.NewChatInfo()
threadId := "19:cbee7c1c860e465f8258e3cebf7bee0d@thread.skype"
chatInfo.SetThreadId(&threadId)
messageId := "1533758867081"
chatInfo.SetMessageId(&messageId)
requestBody.SetChatInfo(chatInfo)
meetingInfo := graphmodels.NewOrganizerMeetingInfo()
organizer := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
id := "5810cede-f3cc-42eb-b2c1-e9bd5d53ec96"
user.SetId(&id)
displayName := "Bob"
user.SetDisplayName(&displayName)
additionalData := map[string]interface{}{
"tenantId" : "aa67bd4c-8475-432d-bd41-39f255720e0a",
}
user.SetAdditionalData(additionalData)
organizer.SetUser(user)
meetingInfo.SetOrganizer(organizer)
allowConversationWithoutHost := true
meetingInfo.SetAllowConversationWithoutHost(&allowConversationWithoutHost)
requestBody.SetMeetingInfo(meetingInfo)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
calls, err := graphClient.Communications().Calls().Post(context.Background(), requestBody, nil)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Call call = new Call();
call.setOdataType("#microsoft.graph.call");
call.setCallbackUri("https://bot.contoso.com/callback");
ParticipantInfo source = new ParticipantInfo();
source.setOdataType("#microsoft.graph.participantInfo");
IdentitySet identity = new IdentitySet();
identity.setOdataType("#microsoft.graph.identitySet");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
Identity guest = new Identity();
guest.setOdataType("#microsoft.graph.identity");
guest.setDisplayName("Guest User");
guest.setId("d7a3b999-17ac-4bca-9e77-e6a730d2ec2e");
additionalData.put("guest", guest);
identity.setAdditionalData(additionalData);
source.setIdentity(identity);
call.setSource(source);
LinkedList<Modality> requestedModalities = new LinkedList<Modality>();
requestedModalities.add(Modality.Audio);
call.setRequestedModalities(requestedModalities);
ServiceHostedMediaConfig mediaConfig = new ServiceHostedMediaConfig();
mediaConfig.setOdataType("#microsoft.graph.serviceHostedMediaConfig");
LinkedList<MediaInfo> preFetchMedia = new LinkedList<MediaInfo>();
MediaInfo mediaInfo = new MediaInfo();
mediaInfo.setUri("https://cdn.contoso.com/beep.wav");
mediaInfo.setResourceId("f8971b04-b53e-418c-9222-c82ce681a582");
preFetchMedia.add(mediaInfo);
MediaInfo mediaInfo1 = new MediaInfo();
mediaInfo1.setUri("https://cdn.contoso.com/cool.wav");
mediaInfo1.setResourceId("86dc814b-c172-4428-9112-60f8ecae1edb");
preFetchMedia.add(mediaInfo1);
mediaConfig.setPreFetchMedia(preFetchMedia);
call.setMediaConfig(mediaConfig);
ChatInfo chatInfo = new ChatInfo();
chatInfo.setOdataType("#microsoft.graph.chatInfo");
chatInfo.setThreadId("19:cbee7c1c860e465f8258e3cebf7bee0d@thread.skype");
chatInfo.setMessageId("1533758867081");
call.setChatInfo(chatInfo);
OrganizerMeetingInfo meetingInfo = new OrganizerMeetingInfo();
meetingInfo.setOdataType("#microsoft.graph.organizerMeetingInfo");
IdentitySet organizer = new IdentitySet();
organizer.setOdataType("#microsoft.graph.identitySet");
Identity user = new Identity();
user.setOdataType("#microsoft.graph.identity");
user.setId("5810cede-f3cc-42eb-b2c1-e9bd5d53ec96");
user.setDisplayName("Bob");
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
additionalData1.put("tenantId", "aa67bd4c-8475-432d-bd41-39f255720e0a");
user.setAdditionalData(additionalData1);
organizer.setUser(user);
meetingInfo.setOrganizer(organizer);
meetingInfo.setAllowConversationWithoutHost(true);
call.setMeetingInfo(meetingInfo);
Call result = graphClient.communications().calls().post(call);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Call;
use Microsoft\Graph\Beta\Generated\Models\ParticipantInfo;
use Microsoft\Graph\Beta\Generated\Models\IdentitySet;
use Microsoft\Graph\Beta\Generated\Models\Identity;
use Microsoft\Graph\Beta\Generated\Models\Modality;
use Microsoft\Graph\Beta\Generated\Models\ServiceHostedMediaConfig;
use Microsoft\Graph\Beta\Generated\Models\MediaInfo;
use Microsoft\Graph\Beta\Generated\Models\ChatInfo;
use Microsoft\Graph\Beta\Generated\Models\OrganizerMeetingInfo;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Call();
$requestBody->setOdataType('#microsoft.graph.call');
$requestBody->setCallbackUri('https://bot.contoso.com/callback');
$source = new ParticipantInfo();
$source->setOdataType('#microsoft.graph.participantInfo');
$sourceIdentity = new IdentitySet();
$sourceIdentity->setOdataType('#microsoft.graph.identitySet');
$additionalData = [
'guest' => [
'@odata.type' => '#microsoft.graph.identity',
'displayName' => 'Guest User',
'id' => 'd7a3b999-17ac-4bca-9e77-e6a730d2ec2e',
],
];
$sourceIdentity->setAdditionalData($additionalData);
$source->setIdentity($sourceIdentity);
$requestBody->setSource($source);
$requestBody->setRequestedModalities([new Modality('audio'), ]);
$mediaConfig = new ServiceHostedMediaConfig();
$mediaConfig->setOdataType('#microsoft.graph.serviceHostedMediaConfig');
$preFetchMediaMediaInfo1 = new MediaInfo();
$preFetchMediaMediaInfo1->setUri('https://cdn.contoso.com/beep.wav');
$preFetchMediaMediaInfo1->setResourceId('f8971b04-b53e-418c-9222-c82ce681a582');
$preFetchMediaArray []= $preFetchMediaMediaInfo1;
$preFetchMediaMediaInfo2 = new MediaInfo();
$preFetchMediaMediaInfo2->setUri('https://cdn.contoso.com/cool.wav');
$preFetchMediaMediaInfo2->setResourceId('86dc814b-c172-4428-9112-60f8ecae1edb');
$preFetchMediaArray []= $preFetchMediaMediaInfo2;
$mediaConfig->setPreFetchMedia($preFetchMediaArray);
$requestBody->setMediaConfig($mediaConfig);
$chatInfo = new ChatInfo();
$chatInfo->setOdataType('#microsoft.graph.chatInfo');
$chatInfo->setThreadId('19:cbee7c1c860e465f8258e3cebf7bee0d@thread.skype');
$chatInfo->setMessageId('1533758867081');
$requestBody->setChatInfo($chatInfo);
$meetingInfo = new OrganizerMeetingInfo();
$meetingInfo->setOdataType('#microsoft.graph.organizerMeetingInfo');
$meetingInfoOrganizer = new IdentitySet();
$meetingInfoOrganizer->setOdataType('#microsoft.graph.identitySet');
$meetingInfoOrganizerUser = new Identity();
$meetingInfoOrganizerUser->setOdataType('#microsoft.graph.identity');
$meetingInfoOrganizerUser->setId('5810cede-f3cc-42eb-b2c1-e9bd5d53ec96');
$meetingInfoOrganizerUser->setDisplayName('Bob');
$additionalData = [
'tenantId' => 'aa67bd4c-8475-432d-bd41-39f255720e0a',
];
$meetingInfoOrganizerUser->setAdditionalData($additionalData);
$meetingInfoOrganizer->setUser($meetingInfoOrganizerUser);
$meetingInfo->setOrganizer($meetingInfoOrganizer);
$meetingInfo->setAllowConversationWithoutHost(true);
$requestBody->setMeetingInfo($meetingInfo);
$result = $graphServiceClient->communications()->calls()->post($requestBody)->wait();
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.call import Call
from msgraph_beta.generated.models.participant_info import ParticipantInfo
from msgraph_beta.generated.models.identity_set import IdentitySet
from msgraph_beta.generated.models.identity import Identity
from msgraph_beta.generated.models.modality import Modality
from msgraph_beta.generated.models.service_hosted_media_config import ServiceHostedMediaConfig
from msgraph_beta.generated.models.media_info import MediaInfo
from msgraph_beta.generated.models.chat_info import ChatInfo
from msgraph_beta.generated.models.organizer_meeting_info import OrganizerMeetingInfo
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Call(
odata_type = "#microsoft.graph.call",
callback_uri = "https://bot.contoso.com/callback",
source = ParticipantInfo(
odata_type = "#microsoft.graph.participantInfo",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
additional_data = {
"guest" : {
"@odata_type" : "#microsoft.graph.identity",
"display_name" : "Guest User",
"id" : "d7a3b999-17ac-4bca-9e77-e6a730d2ec2e",
},
}
),
),
requested_modalities = [
Modality.Audio,
],
media_config = ServiceHostedMediaConfig(
odata_type = "#microsoft.graph.serviceHostedMediaConfig",
pre_fetch_media = [
MediaInfo(
uri = "https://cdn.contoso.com/beep.wav",
resource_id = "f8971b04-b53e-418c-9222-c82ce681a582",
),
MediaInfo(
uri = "https://cdn.contoso.com/cool.wav",
resource_id = "86dc814b-c172-4428-9112-60f8ecae1edb",
),
],
),
chat_info = ChatInfo(
odata_type = "#microsoft.graph.chatInfo",
thread_id = "19:cbee7c1c860e465f8258e3cebf7bee0d@thread.skype",
message_id = "1533758867081",
),
meeting_info = OrganizerMeetingInfo(
odata_type = "#microsoft.graph.organizerMeetingInfo",
organizer = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
user = Identity(
odata_type = "#microsoft.graph.identity",
id = "5810cede-f3cc-42eb-b2c1-e9bd5d53ec96",
display_name = "Bob",
additional_data = {
"tenant_id" : "aa67bd4c-8475-432d-bd41-39f255720e0a",
}
),
),
allow_conversation_without_host = True,
),
)
result = await graph_client.communications.calls.post(request_body)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Nota: A participação de convidados depende das definições de inquilino da reunião. A aplicação pode ser colocada na sala de espera à espera de ser admitida por um utilizador. Esta definição é definida pela isInLobby propriedade
O exemplo seguinte mostra o pedido para fazer uma chamada ponto a ponto entre o bot e um número RTPC. Neste exemplo, o suporte de dados é alojado pelo serviço. Os valores do token de autorização, do URL de chamada de retorno, do ID da instância da aplicação, do nome a apresentar da instância da aplicação, do ID do telefone e do ID do inquilino têm de ser substituídos por valores reais para que o exemplo funcione.
Nota: O ID da instância da aplicação é o ID de objeto da instância da aplicação. O ID da aplicação ao qual a instância da aplicação está ligada deve corresponder ao do token de autorização. O ID de Telefone é o número de telefone no formato E.164.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Call
{
OdataType = "#microsoft.graph.call",
CallbackUri = "https://bot.contoso.com/callback",
Source = new ParticipantInfo
{
OdataType = "#microsoft.graph.participantInfo",
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
AdditionalData = new Dictionary<string, object>
{
{
"applicationInstance" , new Identity
{
OdataType = "#microsoft.graph.identity",
DisplayName = "Calling Bot",
Id = "3d913abb-aec0-4964-8fa6-3c6850c4f278",
}
},
},
},
CountryCode = null,
EndpointType = null,
Region = null,
LanguageId = null,
},
Targets = new List<InvitationParticipantInfo>
{
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",
}
},
},
},
},
},
RequestedModalities = new List<Modality?>
{
Modality.Audio,
},
MediaConfig = new ServiceHostedMediaConfig
{
OdataType = "#microsoft.graph.serviceHostedMediaConfig",
},
TenantId = "aa67bd4c-8475-432d-bd41-39f255720e0a",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Communications.Calls.PostAsync(requestBody);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// 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"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewCall()
callbackUri := "https://bot.contoso.com/callback"
requestBody.SetCallbackUri(&callbackUri)
source := graphmodels.NewParticipantInfo()
identity := graphmodels.NewIdentitySet()
additionalData := map[string]interface{}{
applicationInstance := graphmodels.NewIdentity()
displayName := "Calling Bot"
applicationInstance.SetDisplayName(&displayName)
id := "3d913abb-aec0-4964-8fa6-3c6850c4f278"
applicationInstance.SetId(&id)
identity.SetApplicationInstance(applicationInstance)
}
identity.SetAdditionalData(additionalData)
source.SetIdentity(identity)
countryCode := null
source.SetCountryCode(&countryCode)
endpointType := null
source.SetEndpointType(&endpointType)
region := null
source.SetRegion(®ion)
languageId := null
source.SetLanguageId(&languageId)
requestBody.SetSource(source)
invitationParticipantInfo := graphmodels.NewInvitationParticipantInfo()
identity := graphmodels.NewIdentitySet()
additionalData := map[string]interface{}{
phone := graphmodels.NewIdentity()
id := "+12345678901"
phone.SetId(&id)
identity.SetPhone(phone)
}
identity.SetAdditionalData(additionalData)
invitationParticipantInfo.SetIdentity(identity)
targets := []graphmodels.InvitationParticipantInfoable {
invitationParticipantInfo,
}
requestBody.SetTargets(targets)
requestedModalities := []graphmodels.Modalityable {
modality := graphmodels.AUDIO_MODALITY
requestBody.SetModality(&modality)
}
requestBody.SetRequestedModalities(requestedModalities)
mediaConfig := graphmodels.NewServiceHostedMediaConfig()
requestBody.SetMediaConfig(mediaConfig)
tenantId := "aa67bd4c-8475-432d-bd41-39f255720e0a"
requestBody.SetTenantId(&tenantId)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
calls, err := graphClient.Communications().Calls().Post(context.Background(), requestBody, nil)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Call call = new Call();
call.setOdataType("#microsoft.graph.call");
call.setCallbackUri("https://bot.contoso.com/callback");
ParticipantInfo source = new ParticipantInfo();
source.setOdataType("#microsoft.graph.participantInfo");
IdentitySet identity = new IdentitySet();
identity.setOdataType("#microsoft.graph.identitySet");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
Identity applicationInstance = new Identity();
applicationInstance.setOdataType("#microsoft.graph.identity");
applicationInstance.setDisplayName("Calling Bot");
applicationInstance.setId("3d913abb-aec0-4964-8fa6-3c6850c4f278");
additionalData.put("applicationInstance", applicationInstance);
identity.setAdditionalData(additionalData);
source.setIdentity(identity);
source.setCountryCode(null);
source.setEndpointType(null);
source.setRegion(null);
source.setLanguageId(null);
call.setSource(source);
LinkedList<InvitationParticipantInfo> targets = new LinkedList<InvitationParticipantInfo>();
InvitationParticipantInfo invitationParticipantInfo = new InvitationParticipantInfo();
invitationParticipantInfo.setOdataType("#microsoft.graph.invitationParticipantInfo");
IdentitySet identity1 = new IdentitySet();
identity1.setOdataType("#microsoft.graph.identitySet");
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
Identity phone = new Identity();
phone.setOdataType("#microsoft.graph.identity");
phone.setId("+12345678901");
additionalData1.put("phone", phone);
identity1.setAdditionalData(additionalData1);
invitationParticipantInfo.setIdentity(identity1);
targets.add(invitationParticipantInfo);
call.setTargets(targets);
LinkedList<Modality> requestedModalities = new LinkedList<Modality>();
requestedModalities.add(Modality.Audio);
call.setRequestedModalities(requestedModalities);
ServiceHostedMediaConfig mediaConfig = new ServiceHostedMediaConfig();
mediaConfig.setOdataType("#microsoft.graph.serviceHostedMediaConfig");
call.setMediaConfig(mediaConfig);
call.setTenantId("aa67bd4c-8475-432d-bd41-39f255720e0a");
Call result = graphClient.communications().calls().post(call);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Call;
use Microsoft\Graph\Beta\Generated\Models\ParticipantInfo;
use Microsoft\Graph\Beta\Generated\Models\IdentitySet;
use Microsoft\Graph\Beta\Generated\Models\Identity;
use Microsoft\Graph\Beta\Generated\Models\InvitationParticipantInfo;
use Microsoft\Graph\Beta\Generated\Models\Modality;
use Microsoft\Graph\Beta\Generated\Models\ServiceHostedMediaConfig;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Call();
$requestBody->setOdataType('#microsoft.graph.call');
$requestBody->setCallbackUri('https://bot.contoso.com/callback');
$source = new ParticipantInfo();
$source->setOdataType('#microsoft.graph.participantInfo');
$sourceIdentity = new IdentitySet();
$sourceIdentity->setOdataType('#microsoft.graph.identitySet');
$additionalData = [
'applicationInstance' => [
'@odata.type' => '#microsoft.graph.identity',
'displayName' => 'Calling Bot',
'id' => '3d913abb-aec0-4964-8fa6-3c6850c4f278',
],
];
$sourceIdentity->setAdditionalData($additionalData);
$source->setIdentity($sourceIdentity);
$source->setCountryCode(null);
$source->setEndpointType(null);
$source->setRegion(null);
$source->setLanguageId(null);
$requestBody->setSource($source);
$targetsInvitationParticipantInfo1 = new InvitationParticipantInfo();
$targetsInvitationParticipantInfo1->setOdataType('#microsoft.graph.invitationParticipantInfo');
$targetsInvitationParticipantInfo1Identity = new IdentitySet();
$targetsInvitationParticipantInfo1Identity->setOdataType('#microsoft.graph.identitySet');
$additionalData = [
'phone' => [
'@odata.type' => '#microsoft.graph.identity',
'id' => '+12345678901',
],
];
$targetsInvitationParticipantInfo1Identity->setAdditionalData($additionalData);
$targetsInvitationParticipantInfo1->setIdentity($targetsInvitationParticipantInfo1Identity);
$targetsArray []= $targetsInvitationParticipantInfo1;
$requestBody->setTargets($targetsArray);
$requestBody->setRequestedModalities([new Modality('audio'),]);
$mediaConfig = new ServiceHostedMediaConfig();
$mediaConfig->setOdataType('#microsoft.graph.serviceHostedMediaConfig');
$requestBody->setMediaConfig($mediaConfig);
$requestBody->setTenantId('aa67bd4c-8475-432d-bd41-39f255720e0a');
$result = $graphServiceClient->communications()->calls()->post($requestBody)->wait();
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.call import Call
from msgraph_beta.generated.models.participant_info import ParticipantInfo
from msgraph_beta.generated.models.identity_set import IdentitySet
from msgraph_beta.generated.models.identity import Identity
from msgraph_beta.generated.models.invitation_participant_info import InvitationParticipantInfo
from msgraph_beta.generated.models.modality import Modality
from msgraph_beta.generated.models.service_hosted_media_config import ServiceHostedMediaConfig
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Call(
odata_type = "#microsoft.graph.call",
callback_uri = "https://bot.contoso.com/callback",
source = ParticipantInfo(
odata_type = "#microsoft.graph.participantInfo",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
additional_data = {
"application_instance" : {
"@odata_type" : "#microsoft.graph.identity",
"display_name" : "Calling Bot",
"id" : "3d913abb-aec0-4964-8fa6-3c6850c4f278",
},
}
),
country_code = None,
endpoint_type = None,
region = None,
language_id = None,
),
targets = [
InvitationParticipantInfo(
odata_type = "#microsoft.graph.invitationParticipantInfo",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
additional_data = {
"phone" : {
"@odata_type" : "#microsoft.graph.identity",
"id" : "+12345678901",
},
}
),
),
],
requested_modalities = [
Modality.Audio,
],
media_config = ServiceHostedMediaConfig(
odata_type = "#microsoft.graph.serviceHostedMediaConfig",
),
tenant_id = "aa67bd4c-8475-432d-bd41-39f255720e0a",
)
result = await graph_client.communications.calls.post(request_body)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
O exemplo seguinte mostra um pedido para fazer uma chamada ponto a ponto entre o bot e um número RTPC. Neste exemplo, o suporte de dados é alojado localmente pela aplicação. Os valores do token de autorização, do URL de chamada de retorno, do ID da instância da aplicação, do nome a apresentar da instância da aplicação, do ID do telefone e do ID do inquilino têm de ser substituídos por valores reais para que o exemplo funcione.
Nota: O ID da instância da aplicação é o ID de objeto da instância da aplicação. O ID da aplicação ao qual a instância da aplicação está ligada deve corresponder ao do token de autorização. O ID de Telefone é o número de telefone no formato E.164.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new Call
{
OdataType = "#microsoft.graph.call",
CallbackUri = "https://bot.contoso.com/callback",
Source = new ParticipantInfo
{
OdataType = "#microsoft.graph.participantInfo",
Identity = new IdentitySet
{
OdataType = "#microsoft.graph.identitySet",
AdditionalData = new Dictionary<string, object>
{
{
"applicationInstance" , new Identity
{
OdataType = "#microsoft.graph.identity",
DisplayName = "Calling Bot",
Id = "3d913abb-aec0-4964-8fa6-3c6850c4f278",
}
},
},
},
CountryCode = null,
EndpointType = null,
Region = null,
LanguageId = null,
},
Targets = new List<InvitationParticipantInfo>
{
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",
}
},
},
},
},
},
RequestedModalities = new List<Modality?>
{
Modality.Audio,
},
MediaConfig = new AppHostedMediaConfig
{
OdataType = "#microsoft.graph.appHostedMediaConfig",
Blob = "<Media Session Configuration>",
},
TenantId = "aa67bd4c-8475-432d-bd41-39f255720e0a",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Communications.Calls.PostAsync(requestBody);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// 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"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewCall()
callbackUri := "https://bot.contoso.com/callback"
requestBody.SetCallbackUri(&callbackUri)
source := graphmodels.NewParticipantInfo()
identity := graphmodels.NewIdentitySet()
additionalData := map[string]interface{}{
applicationInstance := graphmodels.NewIdentity()
displayName := "Calling Bot"
applicationInstance.SetDisplayName(&displayName)
id := "3d913abb-aec0-4964-8fa6-3c6850c4f278"
applicationInstance.SetId(&id)
identity.SetApplicationInstance(applicationInstance)
}
identity.SetAdditionalData(additionalData)
source.SetIdentity(identity)
countryCode := null
source.SetCountryCode(&countryCode)
endpointType := null
source.SetEndpointType(&endpointType)
region := null
source.SetRegion(®ion)
languageId := null
source.SetLanguageId(&languageId)
requestBody.SetSource(source)
invitationParticipantInfo := graphmodels.NewInvitationParticipantInfo()
identity := graphmodels.NewIdentitySet()
additionalData := map[string]interface{}{
phone := graphmodels.NewIdentity()
id := "+12345678901"
phone.SetId(&id)
identity.SetPhone(phone)
}
identity.SetAdditionalData(additionalData)
invitationParticipantInfo.SetIdentity(identity)
targets := []graphmodels.InvitationParticipantInfoable {
invitationParticipantInfo,
}
requestBody.SetTargets(targets)
requestedModalities := []graphmodels.Modalityable {
modality := graphmodels.AUDIO_MODALITY
requestBody.SetModality(&modality)
}
requestBody.SetRequestedModalities(requestedModalities)
mediaConfig := graphmodels.NewAppHostedMediaConfig()
blob := "<Media Session Configuration>"
mediaConfig.SetBlob(&blob)
requestBody.SetMediaConfig(mediaConfig)
tenantId := "aa67bd4c-8475-432d-bd41-39f255720e0a"
requestBody.SetTenantId(&tenantId)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
calls, err := graphClient.Communications().Calls().Post(context.Background(), requestBody, nil)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
Call call = new Call();
call.setOdataType("#microsoft.graph.call");
call.setCallbackUri("https://bot.contoso.com/callback");
ParticipantInfo source = new ParticipantInfo();
source.setOdataType("#microsoft.graph.participantInfo");
IdentitySet identity = new IdentitySet();
identity.setOdataType("#microsoft.graph.identitySet");
HashMap<String, Object> additionalData = new HashMap<String, Object>();
Identity applicationInstance = new Identity();
applicationInstance.setOdataType("#microsoft.graph.identity");
applicationInstance.setDisplayName("Calling Bot");
applicationInstance.setId("3d913abb-aec0-4964-8fa6-3c6850c4f278");
additionalData.put("applicationInstance", applicationInstance);
identity.setAdditionalData(additionalData);
source.setIdentity(identity);
source.setCountryCode(null);
source.setEndpointType(null);
source.setRegion(null);
source.setLanguageId(null);
call.setSource(source);
LinkedList<InvitationParticipantInfo> targets = new LinkedList<InvitationParticipantInfo>();
InvitationParticipantInfo invitationParticipantInfo = new InvitationParticipantInfo();
invitationParticipantInfo.setOdataType("#microsoft.graph.invitationParticipantInfo");
IdentitySet identity1 = new IdentitySet();
identity1.setOdataType("#microsoft.graph.identitySet");
HashMap<String, Object> additionalData1 = new HashMap<String, Object>();
Identity phone = new Identity();
phone.setOdataType("#microsoft.graph.identity");
phone.setId("+12345678901");
additionalData1.put("phone", phone);
identity1.setAdditionalData(additionalData1);
invitationParticipantInfo.setIdentity(identity1);
targets.add(invitationParticipantInfo);
call.setTargets(targets);
LinkedList<Modality> requestedModalities = new LinkedList<Modality>();
requestedModalities.add(Modality.Audio);
call.setRequestedModalities(requestedModalities);
AppHostedMediaConfig mediaConfig = new AppHostedMediaConfig();
mediaConfig.setOdataType("#microsoft.graph.appHostedMediaConfig");
mediaConfig.setBlob("<Media Session Configuration>");
call.setMediaConfig(mediaConfig);
call.setTenantId("aa67bd4c-8475-432d-bd41-39f255720e0a");
Call result = graphClient.communications().calls().post(call);
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Call;
use Microsoft\Graph\Beta\Generated\Models\ParticipantInfo;
use Microsoft\Graph\Beta\Generated\Models\IdentitySet;
use Microsoft\Graph\Beta\Generated\Models\Identity;
use Microsoft\Graph\Beta\Generated\Models\InvitationParticipantInfo;
use Microsoft\Graph\Beta\Generated\Models\Modality;
use Microsoft\Graph\Beta\Generated\Models\AppHostedMediaConfig;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Call();
$requestBody->setOdataType('#microsoft.graph.call');
$requestBody->setCallbackUri('https://bot.contoso.com/callback');
$source = new ParticipantInfo();
$source->setOdataType('#microsoft.graph.participantInfo');
$sourceIdentity = new IdentitySet();
$sourceIdentity->setOdataType('#microsoft.graph.identitySet');
$additionalData = [
'applicationInstance' => [
'@odata.type' => '#microsoft.graph.identity',
'displayName' => 'Calling Bot',
'id' => '3d913abb-aec0-4964-8fa6-3c6850c4f278',
],
];
$sourceIdentity->setAdditionalData($additionalData);
$source->setIdentity($sourceIdentity);
$source->setCountryCode(null);
$source->setEndpointType(null);
$source->setRegion(null);
$source->setLanguageId(null);
$requestBody->setSource($source);
$targetsInvitationParticipantInfo1 = new InvitationParticipantInfo();
$targetsInvitationParticipantInfo1->setOdataType('#microsoft.graph.invitationParticipantInfo');
$targetsInvitationParticipantInfo1Identity = new IdentitySet();
$targetsInvitationParticipantInfo1Identity->setOdataType('#microsoft.graph.identitySet');
$additionalData = [
'phone' => [
'@odata.type' => '#microsoft.graph.identity',
'id' => '+12345678901',
],
];
$targetsInvitationParticipantInfo1Identity->setAdditionalData($additionalData);
$targetsInvitationParticipantInfo1->setIdentity($targetsInvitationParticipantInfo1Identity);
$targetsArray []= $targetsInvitationParticipantInfo1;
$requestBody->setTargets($targetsArray);
$requestBody->setRequestedModalities([new Modality('audio'),]);
$mediaConfig = new AppHostedMediaConfig();
$mediaConfig->setOdataType('#microsoft.graph.appHostedMediaConfig');
$mediaConfig->setBlob('<Media Session Configuration>');
$requestBody->setMediaConfig($mediaConfig);
$requestBody->setTenantId('aa67bd4c-8475-432d-bd41-39f255720e0a');
$result = $graphServiceClient->communications()->calls()->post($requestBody)->wait();
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.call import Call
from msgraph_beta.generated.models.participant_info import ParticipantInfo
from msgraph_beta.generated.models.identity_set import IdentitySet
from msgraph_beta.generated.models.identity import Identity
from msgraph_beta.generated.models.invitation_participant_info import InvitationParticipantInfo
from msgraph_beta.generated.models.modality import Modality
from msgraph_beta.generated.models.app_hosted_media_config import AppHostedMediaConfig
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = Call(
odata_type = "#microsoft.graph.call",
callback_uri = "https://bot.contoso.com/callback",
source = ParticipantInfo(
odata_type = "#microsoft.graph.participantInfo",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
additional_data = {
"application_instance" : {
"@odata_type" : "#microsoft.graph.identity",
"display_name" : "Calling Bot",
"id" : "3d913abb-aec0-4964-8fa6-3c6850c4f278",
},
}
),
country_code = None,
endpoint_type = None,
region = None,
language_id = None,
),
targets = [
InvitationParticipantInfo(
odata_type = "#microsoft.graph.invitationParticipantInfo",
identity = IdentitySet(
odata_type = "#microsoft.graph.identitySet",
additional_data = {
"phone" : {
"@odata_type" : "#microsoft.graph.identity",
"id" : "+12345678901",
},
}
),
),
],
requested_modalities = [
Modality.Audio,
],
media_config = AppHostedMediaConfig(
odata_type = "#microsoft.graph.appHostedMediaConfig",
blob = "<Media Session Configuration>",
),
tenant_id = "aa67bd4c-8475-432d-bd41-39f255720e0a",
)
result = await graph_client.communications.calls.post(request_body)
Importante
Os SDKs do Microsoft Graph usam a versão v1.0 da API por padrão e não oferecem suporte a todos os tipos, propriedades e APIs disponíveis na versão beta. Para obter detalhes sobre como acessar a API beta com o SDK, consulte Usar os SDKs do Microsoft Graph com a API beta.