Espace de noms: microsoft.graph
Créez un objet onlineMeeting avec un ID externe spécifié personnalisé. Si l’ID externe existe déjà, cette API retourne l’objet onlineMeeting avec cet ID externe.
Remarque: la réunion ne s’affiche pas dans le calendrier de l’utilisateur.
Cette API est disponible dans les déploiements de cloud national suivants.
| Service global |
Gouvernement des États-Unis L4 |
Us Government L5 (DOD) |
Chine gérée par 21Vianet |
| ✅ |
✅ |
✅ |
❌ |
Autorisations
L’une des autorisations suivantes est nécessaire pour appeler cette API. Pour plus d’informations, notamment sur la façon de choisir les autorisations, voir Autorisations.
| Type d’autorisation |
Autorisations (de celle qui offre le plus de privilèges à celle qui en offre le moins) |
| Déléguée (compte professionnel ou scolaire) |
OnlineMeetings.ReadWrite |
| Déléguée (compte Microsoft personnel) |
Non prise en charge. |
| Application |
OnlineMeetings.ReadWrite.All* |
Importante
* Les administrateurs doivent créer une stratégie d’accès à l’application et l’accorder à un utilisateur, en autorisant l’application configurée dans la stratégie à créer ou à obtenir une réunion en ligne avec l’ID externe pour le compte de cet utilisateur (ID utilisateur spécifié dans le chemin de la demande).
Requête HTTP
Pour appeler l’API createOrGet avec un jeton délégué :
POST /me/onlineMeetings/createOrGet
Pour appeler l’API createOrGet avec un jeton d’application :
POST /users/{userId}/onlineMeetings/createOrGet
Corps de la demande
Dans le corps de la demande, indiquez un objet JSON avec les paramètres suivants.
| Paramètre |
Type |
Description |
| endDateTime |
DateTime |
Heure de fin de la réunion au format UTC. |
| externalId |
String |
ID externe. ID personnalisé. (Obligatoire) |
| participants |
meetingParticipants |
Participants associés à la réunion en ligne. Cela inclut l’organisateur et les participants. |
| startDateTime |
DateTime |
Heure de début de la réunion au format UTC. |
| sujet |
String |
Objet de la réunion en ligne. |
Remarques :
- Si les valeurs startDateTime et endDateTime ne sont pas fournies, startDateTime est définie par défaut sur la valeur dateTime actuelle et la valeur endDateTime est égale à startDateTime + 1 heure.
- Si la valeur startDateTime est fournie, mais que endDateTime ne l’est pas, la valeur endDateTime est égale à startDateTime + 1 heure.
- Une erreur est générée si endDateTime est fourni sans startDateTime ou si endDateTime est antérieur à startDateTime.
- Lorsque plusieurs utilisateurs du même locataire utilisent le même externalId pour exécuter cette requête, différentes instances de réunion sont générées, chacune avec son propre ID unique. La combinaison de tenantId, userId et externalId sert d’identificateur pour une réunion avec un ID externe.
Réponse
Si elle réussit, cette méthode renvoie un 201 Created code de réponse si une nouvelle réunion est créée, ou un 200 OK code de réponse si une réunion existante est récupérée. Dans les deux cas, un objet onlineMeeting est retourné dans le corps de la réponse.
Exemples
Demande
L’exemple suivant montre comment créer ou obtenir une réunion en ligne avec un ID externe.
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"
}
]
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Me.OnlineMeetings.CreateOrGet;
using Microsoft.Graph.Models;
var requestBody = new CreateOrGetPostRequestBody
{
StartDateTime = DateTimeOffset.Parse("2020-02-06T01:49:21.3524945+00:00"),
EndDateTime = DateTimeOffset.Parse("2020-02-06T02:19:21.3524945+00:00"),
Subject = "Create a meeting with customId provided",
ExternalId = "7eb8263f-d0e0-4149-bb1c-1f0476083c56",
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",
},
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.OnlineMeetings.CreateOrGet.PostAsync(requestBody);
Pour plus d’informations sur la façon d'ajouter le Kit de développement logiciel (SDK) à votre projet et créer une instance authProvider, consultez la documentation du Kit de développement logiciel (SDK).
// 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"
graphusers "github.com/microsoftgraph/msgraph-sdk-go/users"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphusers.NewItemCreateOrGetPostRequestBody()
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 := graphmodels.NewMeetingParticipants()
meetingParticipantInfo := graphmodels.NewMeetingParticipantInfo()
identity := graphmodels.NewIdentitySet()
user := graphmodels.NewIdentity()
id := "1f35f2e6-9cab-44ad-8d5a-b74c14720000"
user.SetId(&id)
identity.SetUser(user)
meetingParticipantInfo.SetIdentity(identity)
upn := "test1@contoso.com"
meetingParticipantInfo.SetUpn(&upn)
attendees := []graphmodels.MeetingParticipantInfoable {
meetingParticipantInfo,
}
participants.SetAttendees(attendees)
requestBody.SetParticipants(participants)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
createOrGet, err := graphClient.Me().OnlineMeetings().CreateOrGet().Post(context.Background(), requestBody, nil)
Pour plus d’informations sur la façon d'ajouter le Kit de développement logiciel (SDK) à votre projet et créer une instance authProvider, consultez la documentation du Kit de développement logiciel (SDK).
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.users.item.onlinemeetings.createorget.CreateOrGetPostRequestBody createOrGetPostRequestBody = new com.microsoft.graph.users.item.onlinemeetings.createorget.CreateOrGetPostRequestBody();
OffsetDateTime startDateTime = OffsetDateTime.parse("2020-02-06T01:49:21.3524945+00:00");
createOrGetPostRequestBody.setStartDateTime(startDateTime);
OffsetDateTime endDateTime = OffsetDateTime.parse("2020-02-06T02:19:21.3524945+00:00");
createOrGetPostRequestBody.setEndDateTime(endDateTime);
createOrGetPostRequestBody.setSubject("Create a meeting with customId provided");
createOrGetPostRequestBody.setExternalId("7eb8263f-d0e0-4149-bb1c-1f0476083c56");
MeetingParticipants participants = new MeetingParticipants();
LinkedList<MeetingParticipantInfo> attendees = new LinkedList<MeetingParticipantInfo>();
MeetingParticipantInfo meetingParticipantInfo = new MeetingParticipantInfo();
IdentitySet identity = new IdentitySet();
Identity user = new Identity();
user.setId("1f35f2e6-9cab-44ad-8d5a-b74c14720000");
identity.setUser(user);
meetingParticipantInfo.setIdentity(identity);
meetingParticipantInfo.setUpn("test1@contoso.com");
attendees.add(meetingParticipantInfo);
participants.setAttendees(attendees);
createOrGetPostRequestBody.setParticipants(participants);
var result = graphClient.me().onlineMeetings().createOrGet().post(createOrGetPostRequestBody);
Pour plus d’informations sur la façon d'ajouter le Kit de développement logiciel (SDK) à votre projet et créer une instance authProvider, consultez la documentation du Kit de développement logiciel (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);
Pour plus d’informations sur la façon d'ajouter le Kit de développement logiciel (SDK) à votre projet et créer une instance authProvider, consultez la documentation du Kit de développement logiciel (SDK).
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Users\Item\OnlineMeetings\CreateOrGet\CreateOrGetPostRequestBody;
use Microsoft\Graph\Generated\Models\MeetingParticipants;
use Microsoft\Graph\Generated\Models\MeetingParticipantInfo;
use Microsoft\Graph\Generated\Models\IdentitySet;
use Microsoft\Graph\Generated\Models\Identity;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new CreateOrGetPostRequestBody();
$requestBody->setStartDateTime(new \DateTime('2020-02-06T01:49:21.3524945+00:00'));
$requestBody->setEndDateTime(new \DateTime('2020-02-06T02:19:21.3524945+00:00'));
$requestBody->setSubject('Create a meeting with customId provided');
$requestBody->setExternalId('7eb8263f-d0e0-4149-bb1c-1f0476083c56');
$participants = new MeetingParticipants();
$attendeesMeetingParticipantInfo1 = new MeetingParticipantInfo();
$attendeesMeetingParticipantInfo1Identity = new IdentitySet();
$attendeesMeetingParticipantInfo1IdentityUser = new Identity();
$attendeesMeetingParticipantInfo1IdentityUser->setId('1f35f2e6-9cab-44ad-8d5a-b74c14720000');
$attendeesMeetingParticipantInfo1Identity->setUser($attendeesMeetingParticipantInfo1IdentityUser);
$attendeesMeetingParticipantInfo1->setIdentity($attendeesMeetingParticipantInfo1Identity);
$attendeesMeetingParticipantInfo1->setUpn('test1@contoso.com');
$attendeesArray []= $attendeesMeetingParticipantInfo1;
$participants->setAttendees($attendeesArray);
$requestBody->setParticipants($participants);
$result = $graphServiceClient->me()->onlineMeetings()->createOrGet()->post($requestBody)->wait();
Pour plus d’informations sur la façon d'ajouter le Kit de développement logiciel (SDK) à votre projet et créer une instance authProvider, consultez la documentation du Kit de développement logiciel (SDK).
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.users.item.onlinemeetings.create_or_get.create_or_get_post_request_body import CreateOrGetPostRequestBody
from msgraph.generated.models.meeting_participants import MeetingParticipants
from msgraph.generated.models.meeting_participant_info import MeetingParticipantInfo
from msgraph.generated.models.identity_set import IdentitySet
from msgraph.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 = CreateOrGetPostRequestBody(
start_date_time = "2020-02-06T01:49:21.3524945+00:00",
end_date_time = "2020-02-06T02:19:21.3524945+00:00",
subject = "Create a meeting with customId provided",
external_id = "7eb8263f-d0e0-4149-bb1c-1f0476083c56",
participants = MeetingParticipants(
attendees = [
MeetingParticipantInfo(
identity = IdentitySet(
user = Identity(
id = "1f35f2e6-9cab-44ad-8d5a-b74c14720000",
),
),
upn = "test1@contoso.com",
),
],
),
)
result = await graph_client.me.online_meetings.create_or_get.post(request_body)
Pour plus d’informations sur la façon d'ajouter le Kit de développement logiciel (SDK) à votre projet et créer une instance authProvider, consultez la documentation du Kit de développement logiciel (SDK).
Réponse
Remarque : l’objet de réponse affiché ci-après peut être raccourci pour plus de lisibilité.
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
},
}