Esta API cria uma reunião autónoma que não está associada a nenhum evento no calendário do utilizador; Por conseguinte, as reuniões criadas através desta API não são apresentadas no calendário do utilizador.
Esta API não cria um evento em direto do Teams.
Para obter transcrições de reuniões numa fase posterior, utilize a API Criar eventos com o apoio do calendário.
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.
Tipo de permissão
Permissões com menos privilégios
Permissões com privilégios superiores
Delegado (conta corporativa ou de estudante)
OnlineMeetings.ReadWrite
Indisponível.
Delegado (conta pessoal da Microsoft)
Sem suporte.
Sem suporte.
Aplicativo
Sem suporte.
Sem suporte.
Para usar a permissão de aplicativo para essa API, os administradores de locatários devem criar uma política de acesso de aplicativo e concedê-la a um usuário para autorizar o aplicativo configurado na política a criar reuniões online em nome desse usuário (com a ID de usuário especificada no caminho da solicitação).
Solicitação HTTP
Criar uma reunião online com permissão delegada (/me) e aplicativo (/users/{userId}):
POST /me/onlineMeetings
POST /users/{userId}/onlineMeetings
Se a solicitação contiver um Accept-Languagecabeçalho HTTP, o content de joinInformation estará na variante de idioma e código de idioma especificada Accept-Language no cabeçalho. O conteúdo predefinido está em inglês.
Corpo da solicitação
No corpo da solicitação, forneça uma representação JSON de um objeto onlineMeeting.
Cuidado
A atribuição da presenter função ou coorganizer aos utilizadores que não estão registados no Microsoft Entra ID não é atualmente suportada.
Resposta
Se bem-sucedido, este método retorna o código de resposta 201 Created e um objeto onlineMeeting no corpo da resposta.
Exemplos
Exemplo 1: Crie uma reunião online com token de usuário
O exemplo a seguir cria uma reunião online com um token de usuário.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new OnlineMeeting
{
StartDateTime = DateTimeOffset.Parse("2019-07-12T14:30:34.2444915-07:00"),
EndDateTime = DateTimeOffset.Parse("2019-07-12T15:00:34.2464912-07:00"),
Subject = "User Token Meeting",
};
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.OnlineMeetings.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
"time"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewOnlineMeeting()
startDateTime , err := time.Parse(time.RFC3339, "2019-07-12T14:30:34.2444915-07:00")
requestBody.SetStartDateTime(&startDateTime)
endDateTime , err := time.Parse(time.RFC3339, "2019-07-12T15:00:34.2464912-07:00")
requestBody.SetEndDateTime(&endDateTime)
subject := "User Token Meeting"
requestBody.SetSubject(&subject)
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
onlineMeetings, err := graphClient.Me().OnlineMeetings().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
OnlineMeeting onlineMeeting = new OnlineMeeting();
OffsetDateTime startDateTime = OffsetDateTime.parse("2019-07-12T14:30:34.2444915-07:00");
onlineMeeting.setStartDateTime(startDateTime);
OffsetDateTime endDateTime = OffsetDateTime.parse("2019-07-12T15:00:34.2464912-07:00");
onlineMeeting.setEndDateTime(endDateTime);
onlineMeeting.setSubject("User Token Meeting");
OnlineMeeting result = graphClient.me().onlineMeetings().post(onlineMeeting);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.online_meeting import OnlineMeeting
# To initialize your graph_client, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = OnlineMeeting(
start_date_time = "2019-07-12T14:30:34.2444915-07:00",
end_date_time = "2019-07-12T15:00:34.2464912-07:00",
subject = "User Token Meeting",
)
result = await graph_client.me.online_meetings.post(request_body)
Exemplo 2: criar uma reunião online que exija um código de acesso
O seguinte exemplo mostra como adicionar uma senha a uma reunião. A senha é usada quando você ingressa em uma reunião com uma joinMeetingId. Para obter mais informações, veja joinMeetingIdSettings.
Solicitação
Eis um exemplo de um pedido.
Nota: O código de acesso é gerado automaticamente e não é suportado um código de acesso personalizado.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new OnlineMeeting
{
StartDateTime = DateTimeOffset.Parse("2019-07-12T14:30:34.2444915-07:00"),
EndDateTime = DateTimeOffset.Parse("2019-07-12T15:00:34.2464912-07:00"),
Subject = "User meeting",
JoinMeetingIdSettings = new JoinMeetingIdSettings
{
IsPasscodeRequired = true,
},
};
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.OnlineMeetings.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
OnlineMeeting onlineMeeting = new OnlineMeeting();
OffsetDateTime startDateTime = OffsetDateTime.parse("2019-07-12T14:30:34.2444915-07:00");
onlineMeeting.setStartDateTime(startDateTime);
OffsetDateTime endDateTime = OffsetDateTime.parse("2019-07-12T15:00:34.2464912-07:00");
onlineMeeting.setEndDateTime(endDateTime);
onlineMeeting.setSubject("User meeting");
JoinMeetingIdSettings joinMeetingIdSettings = new JoinMeetingIdSettings();
joinMeetingIdSettings.setIsPasscodeRequired(true);
onlineMeeting.setJoinMeetingIdSettings(joinMeetingIdSettings);
OnlineMeeting result = graphClient.me().onlineMeetings().post(onlineMeeting);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.online_meeting import OnlineMeeting
from msgraph.generated.models.join_meeting_id_settings import JoinMeetingIdSettings
# To initialize your graph_client, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = OnlineMeeting(
start_date_time = "2019-07-12T14:30:34.2444915-07:00",
end_date_time = "2019-07-12T15:00:34.2464912-07:00",
subject = "User meeting",
join_meeting_id_settings = JoinMeetingIdSettings(
is_passcode_required = True,
),
)
result = await graph_client.me.online_meetings.post(request_body)
Exemplo 3: criar uma reunião online que não requer um código de acesso
Quando isPasscodeRequired está definido como false ou quando joinMeetingIdSettings não é especificado no pedido, a reunião online gerada não terá um código de acesso.
POST https://graph.microsoft.com/v1.0/me/onlineMeetings
Content-Type: application/json
{
"startDateTime":"2019-07-12T14:30:34.2444915-07:00",
"endDateTime":"2019-07-12T15:00:34.2464912-07:00",
"subject":"User meeting in Microsoft Teams channel.",
"joinMeetingIdSettings": {
"isPasscodeRequired": false
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new OnlineMeeting
{
StartDateTime = DateTimeOffset.Parse("2019-07-12T14:30:34.2444915-07:00"),
EndDateTime = DateTimeOffset.Parse("2019-07-12T15:00:34.2464912-07:00"),
Subject = "User meeting in Microsoft Teams channel.",
JoinMeetingIdSettings = new JoinMeetingIdSettings
{
IsPasscodeRequired = false,
},
};
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.OnlineMeetings.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
"time"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewOnlineMeeting()
startDateTime , err := time.Parse(time.RFC3339, "2019-07-12T14:30:34.2444915-07:00")
requestBody.SetStartDateTime(&startDateTime)
endDateTime , err := time.Parse(time.RFC3339, "2019-07-12T15:00:34.2464912-07:00")
requestBody.SetEndDateTime(&endDateTime)
subject := "User meeting in Microsoft Teams channel."
requestBody.SetSubject(&subject)
joinMeetingIdSettings := graphmodels.NewJoinMeetingIdSettings()
isPasscodeRequired := false
joinMeetingIdSettings.SetIsPasscodeRequired(&isPasscodeRequired)
requestBody.SetJoinMeetingIdSettings(joinMeetingIdSettings)
// To initialize your graphClient, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
onlineMeetings, err := graphClient.Me().OnlineMeetings().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
OnlineMeeting onlineMeeting = new OnlineMeeting();
OffsetDateTime startDateTime = OffsetDateTime.parse("2019-07-12T14:30:34.2444915-07:00");
onlineMeeting.setStartDateTime(startDateTime);
OffsetDateTime endDateTime = OffsetDateTime.parse("2019-07-12T15:00:34.2464912-07:00");
onlineMeeting.setEndDateTime(endDateTime);
onlineMeeting.setSubject("User meeting in Microsoft Teams channel.");
JoinMeetingIdSettings joinMeetingIdSettings = new JoinMeetingIdSettings();
joinMeetingIdSettings.setIsPasscodeRequired(false);
onlineMeeting.setJoinMeetingIdSettings(joinMeetingIdSettings);
OnlineMeeting result = graphClient.me().onlineMeetings().post(onlineMeeting);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\OnlineMeeting;
use Microsoft\Graph\Generated\Models\JoinMeetingIdSettings;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new OnlineMeeting();
$requestBody->setStartDateTime(new \DateTime('2019-07-12T14:30:34.2444915-07:00'));
$requestBody->setEndDateTime(new \DateTime('2019-07-12T15:00:34.2464912-07:00'));
$requestBody->setSubject('User meeting in Microsoft Teams channel.');
$joinMeetingIdSettings = new JoinMeetingIdSettings();
$joinMeetingIdSettings->setIsPasscodeRequired(false);
$requestBody->setJoinMeetingIdSettings($joinMeetingIdSettings);
$result = $graphServiceClient->me()->onlineMeetings()->post($requestBody)->wait();
Import-Module Microsoft.Graph.CloudCommunications
$params = @{
startDateTime = [System.DateTime]::Parse("2019-07-12T14:30:34.2444915-07:00")
endDateTime = [System.DateTime]::Parse("2019-07-12T15:00:34.2464912-07:00")
subject = "User meeting in Microsoft Teams channel."
joinMeetingIdSettings = @{
isPasscodeRequired = $false
}
}
# A UPN can also be used as -UserId.
New-MgUserOnlineMeeting -UserId $userId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.online_meeting import OnlineMeeting
from msgraph.generated.models.join_meeting_id_settings import JoinMeetingIdSettings
# To initialize your graph_client, see https://video2.skills-academy.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = OnlineMeeting(
start_date_time = "2019-07-12T14:30:34.2444915-07:00",
end_date_time = "2019-07-12T15:00:34.2464912-07:00",
subject = "User meeting in Microsoft Teams channel.",
join_meeting_id_settings = JoinMeetingIdSettings(
is_passcode_required = False,
),
)
result = await graph_client.me.online_meetings.post(request_body)
POST https://graph.microsoft.com/v1.0/me/onlineMeetings
Content-Type: application/json
{
"startDateTime":"2019-07-12T14:30:34.2444915-07:00",
"endDateTime":"2019-07-12T15:00:34.2464912-07:00",
"subject":"User meeting in Microsoft Teams channel."
}
Resposta
Veja um exemplo de resposta.
Observação: o objeto de resposta mostrado aqui pode ser encurtado para legibilidade.