onlineMeeting: createOrGet
Artigo
07/18/2022
5 minutos para o fim da leitura
3 colaboradores
Neste artigo
Namespace: microsoft.graph
Crie um objeto onlineMeeting com uma ID externa especificada personalizada. Se a ID externa já existir, essa API retornará o objeto onlineMeeting com essa ID externa.
Observação : a reunião não é exibida no calendário do usuário.
Permissões
Uma das seguintes permissões é obrigatória para chamar esta API. Para saber mais, incluindo como escolher permissões, confira Permissões .
Tipo de permissão
Permissões (da com menos para a com mais privilégios)
Delegado (conta corporativa ou de estudante)
OnlineMeetings.ReadWrite
Delegado (conta pessoal da Microsoft)
Sem suporte.
Aplicativo
OnlineMeetings.ReadWrite.All*
Importante
*Os administradores devem criar uma política de acesso a aplicativos e concedi-la a um usuário, autorizando o aplicativo configurado na política para criar ou obter uma reunião online com a ID externa em nome desse usuário (ID do usuário especificada no caminho da solicitação).
Solicitação HTTP
Para chamar a API createOrGet com token delegado:
POST /me/onlineMeetings/createOrGet
Para chamar a API createOrGet com token de aplicativo:
POST /users/{userId}/onlineMeetings/createOrGet
Nome
Descrição
Autorização
{token} de portador. Obrigatório.
Content-type
application/json. Obrigatório.
Corpo da solicitação
Forneça um objeto JSON com os seguintes parâmetros no corpo da solicitação.
Parâmetro
Tipo
Descrição
endDateTime
DateTime
A hora de término da reunião em UTC.
externalId
Cadeia de caracteres
A ID externa. Uma ID personalizada. (Obrigatório)
participants
meetingParticipants
Os participantes associados à reunião online. Isso inclui o organizador e os participantes.
startDateTime
DateTime
O horário de início da reunião em UTC.
assunto
Cadeia de caracteres
O assunto da reunião online.
Observações:
Se o startDateTime e endDateTime não são fornecidos, o startDateTime será padrão para o valor dateTime atual e o valor endDateTime será igual ao startDateTime + 1 hora.
Se o startDateTime for fornecido, mas endDateTime não for, o valor endDateTime será igual ao startDateTime + 1 hora.
Um erro será lançado se endDateTime for fornecido sem o startDateTime ou se endDateTime for anterior ao startDateTime .
Resposta
Se tiver êxito, este método retornará um 201 Created código de resposta se uma nova reunião for criada ou 200 OK um código de resposta se uma reunião existente for recuperada. Em ambos os casos, um objeto onlineMeeting é retornado no corpo da resposta.
Exemplos
Solicitação
O exemplo a seguir mostra como criar ou obter uma reunião online com uma ID externa.
POST https://graph.microsoft.com/v1.0/me/onlineMeetings/createOrGet
Content-Type: application/json
{
"startDateTime": "2020-02-06T01:49:21.3524945+00:00",
"endDateTime": "2020-02-06T02:19:21.3524945+00:00",
"subject": "Create a meeting with customId provided",
"externalId": "7eb8263f-d0e0-4149-bb1c-1f0476083c56",
"participants": {
"attendees": [
{
"identity": {
"user": {
"id": "1f35f2e6-9cab-44ad-8d5a-b74c14720000"
}
},
"upn": "test1@contoso.com"
}
]
}
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var startDateTime = DateTimeOffset.Parse("2020-02-06T01:49:21.3524945+00:00");
var endDateTime = DateTimeOffset.Parse("2020-02-06T02:19:21.3524945+00:00");
var subject = "Create a meeting with customId provided";
var externalId = "7eb8263f-d0e0-4149-bb1c-1f0476083c56";
var participants = new MeetingParticipants
{
Attendees = new List<MeetingParticipantInfo>()
{
new MeetingParticipantInfo
{
Identity = new IdentitySet
{
User = new Identity
{
Id = "1f35f2e6-9cab-44ad-8d5a-b74c14720000"
}
},
Upn = "test1@contoso.com"
}
}
};
await graphClient.Me.OnlineMeetings
.CreateOrGet(externalId,null,endDateTime,participants,startDateTime,subject)
.Request()
.PostAsync();
Para obter detalhes sobre como adicionar o SDK ao seu projeto e criar uma instância authProvider , consulte a documentação do SDK .
const options = {
authProvider,
};
const client = Client.init(options);
const onlineMeeting = {
startDateTime: '2020-02-06T01:49:21.3524945+00:00',
endDateTime: '2020-02-06T02:19:21.3524945+00:00',
subject: 'Create a meeting with customId provided',
externalId: '7eb8263f-d0e0-4149-bb1c-1f0476083c56',
participants: {
attendees: [
{
identity: {
user: {
id: '1f35f2e6-9cab-44ad-8d5a-b74c14720000'
}
},
upn: 'test1@contoso.com'
}
]
}
};
await client.api('/me/onlineMeetings/createOrGet')
.post(onlineMeeting);
Para obter detalhes sobre como adicionar o SDK ao seu projeto e criar uma instância authProvider , consulte a documentação do SDK .
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/me/onlineMeetings/createOrGet"]]];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSMutableDictionary *payloadDictionary = [[NSMutableDictionary alloc] init];
NSString *startDateTimeDateTimeString = @"02/06/2020 01:49:21";
NSDate *startDateTime = [NSDate ms_dateFromString: startDateTimeDateTimeString];
payloadDictionary[@"startDateTime"] = startDateTime;
NSString *endDateTimeDateTimeString = @"02/06/2020 02:19:21";
NSDate *endDateTime = [NSDate ms_dateFromString: endDateTimeDateTimeString];
payloadDictionary[@"endDateTime"] = endDateTime;
NSString *subject = @"Create a meeting with customId provided";
payloadDictionary[@"subject"] = subject;
NSString *externalId = @"7eb8263f-d0e0-4149-bb1c-1f0476083c56";
payloadDictionary[@"externalId"] = externalId;
MSGraphMeetingParticipants *participants = [[MSGraphMeetingParticipants alloc] init];
NSMutableArray *attendeesList = [[NSMutableArray alloc] init];
MSGraphMeetingParticipantInfo *attendees = [[MSGraphMeetingParticipantInfo alloc] init];
MSGraphIdentitySet *identity = [[MSGraphIdentitySet alloc] init];
MSGraphIdentity *user = [[MSGraphIdentity alloc] init];
[user setId:@"1f35f2e6-9cab-44ad-8d5a-b74c14720000"];
[identity setUser:user];
[attendees setIdentity:identity];
[attendees setUpn:@"test1@contoso.com"];
[attendeesList addObject: attendees];
[participants setAttendees:attendeesList];
payloadDictionary[@"participants"] = participants;
NSData *data = [NSJSONSerialization dataWithJSONObject:payloadDictionary options:kNilOptions error:&error];
[urlRequest setHTTPBody:data];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
Para obter detalhes sobre como adicionar o SDK ao seu projeto e criar uma instância authProvider , consulte a documentação do SDK .
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
OffsetDateTime startDateTime = OffsetDateTimeSerializer.deserialize("02/06/2020 01:49:21");
OffsetDateTime endDateTime = OffsetDateTimeSerializer.deserialize("02/06/2020 02:19:21");
String subject = "Create a meeting with customId provided";
String externalId = "7eb8263f-d0e0-4149-bb1c-1f0476083c56";
MeetingParticipants participants = new MeetingParticipants();
LinkedList<MeetingParticipantInfo> attendeesList = new LinkedList<MeetingParticipantInfo>();
MeetingParticipantInfo attendees = new MeetingParticipantInfo();
IdentitySet identity = new IdentitySet();
Identity user = new Identity();
user.id = "1f35f2e6-9cab-44ad-8d5a-b74c14720000";
identity.user = user;
attendees.identity = identity;
attendees.upn = "test1@contoso.com";
attendeesList.add(attendees);
participants.attendees = attendeesList;
graphClient.me().onlineMeetings()
.createOrGet(OnlineMeetingCreateOrGetParameterSet
.newBuilder()
.withChatInfo(null)
.withEndDateTime(endDateTime)
.withExternalId(externalId)
.withParticipants(participants)
.withStartDateTime(startDateTime)
.withSubject(subject)
.build())
.buildRequest()
.post();
Para obter detalhes sobre como adicionar o SDK ao seu projeto e criar uma instância authProvider , consulte a documentação do SDK .
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.New()
startDateTime, err := time.Parse(time.RFC3339, "2020-02-06T01:49:21.3524945+00:00")
requestBody.SetStartDateTime(&startDateTime)
endDateTime, err := time.Parse(time.RFC3339, "2020-02-06T02:19:21.3524945+00:00")
requestBody.SetEndDateTime(&endDateTime)
subject := "Create a meeting with customId provided"
requestBody.SetSubject(&subject)
externalId := "7eb8263f-d0e0-4149-bb1c-1f0476083c56"
requestBody.SetExternalId(&externalId)
participants := msgraphsdk.NewMeetingParticipants()
requestBody.SetParticipants(participants)
participants.SetAttendees( []MeetingParticipantInfo {
msgraphsdk.NewMeetingParticipantInfo(),
identity := msgraphsdk.NewIdentitySet()
SetIdentity(identity)
user := msgraphsdk.NewIdentity()
identity.SetUser(user)
id := "1f35f2e6-9cab-44ad-8d5a-b74c14720000"
user.SetId(&id)
upn := "test1@contoso.com"
SetUpn(&upn)
}
result, err := graphClient.Me().OnlineMeetings().CreateOrGet().Post(requestBody)
Para obter detalhes sobre como adicionar o SDK ao seu projeto e criar uma instância authProvider , consulte a documentação do SDK .
Import-Module Microsoft.Graph.Users.Actions
$params = @{
StartDateTime = [System.DateTime]::Parse("2020-02-06T01:49:21.3524945+00:00")
EndDateTime = [System.DateTime]::Parse("2020-02-06T02:19:21.3524945+00:00")
Subject = "Create a meeting with customId provided"
ExternalId = "7eb8263f-d0e0-4149-bb1c-1f0476083c56"
Participants = @{
Attendees = @(
@{
Identity = @{
User = @{
Id = "1f35f2e6-9cab-44ad-8d5a-b74c14720000"
}
}
Upn = "test1@contoso.com"
}
)
}
}
# A UPN can also be used as -UserId.
Invoke-MgCreateOrGetUserOnlineMeeting -UserId $userId -BodyParameter $params
Para obter detalhes sobre como adicionar o SDK ao seu projeto e criar uma instância authProvider , consulte a documentação do SDK .
Resposta
Observação: o objeto de resposta mostrado aqui pode ser encurtado para legibilidade.
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "(redacted)",
"creationDateTime": "2020-09-11T06:30:18.1909168Z",
"startDateTime": "2020-09-11T06:30:18.0615989Z",
"endDateTime": "2020-09-11T07:30:18.0615989Z",
"joinWebUrl": "(redacted)",
"subject": "Create a meeting with customId provided",
"isBroadcast": false,
"autoAdmittedUsers": "EveryoneInCompany",
"isEntryExitAnnounced": true,
"allowedPresenters": "everyone",
"videoTeleconferenceId": "(redacted)",
"externalId": "7eb8263f-d0e0-4149-bb1c-1f0476083c56",
"participants": {
"organizer": {
"upn": "(redacted)",
"role": "presenter",
"identity": {
"user": {
"id": "(redacted)",
}
}
},
"attendees": [
{
"upn": "test1@contoso.com",
"role": null,
"identity": {
"user": {
"id": "1f35f2e6-9cab-44ad-8d5a-b74c14720000",
}
}
}
],
"producers": [],
"contributors": []
},
"lobbyBypassSettings": {
"scope": "organization",
"isDialInBypassEnabled": false
},
"audioConferencing": {
"conferenceId": "(redacted)",
"tollNumber": "+1 206-485-3005",
"tollFreeNumber": null,
"dialinUrl": "https://dialin.teams.microsoft.com/0e73a853-1cc2-436c-b18c-9f53e0a97c24?id=(redacted)"
},
"chatInfo": {
"threadId": "19:7ebda77322dd4505ac4dedb5b67df076@thread.tacv2",
"messageId": "0",
"replyChainMessageId": null
},
}