Independentsoft
Professional software libraries for developers
Home
Purchase
Support
Company
Contact
Graph C++
>
Tutorial
> Create online meeting
The following example shows you how to create an online meeting.
C++ example
#include
#include
#include "independentsoft/graph/graph_client.hpp" #include "independentsoft/graph/graph_exception.hpp" #include "independentsoft/graph/users/user.hpp" #include "independentsoft/graph/teams/online_meeting.hpp" #include "independentsoft/graph/teams/online_meeting_presenters.hpp" #include "independentsoft/graph/teams/join_meeting_id_settings.hpp" #include "independentsoft/graph/teams/communications_identity_set.hpp" #include "independentsoft/graph/teams/communications_user_identity.hpp" #include "independentsoft/graph/teams/meeting_participant_info.hpp" #include "independentsoft/graph/teams/meeting_participants.hpp" using namespace independentsoft::graph; using namespace independentsoft::graph::teams; using namespace independentsoft::graph::users; int main() { try { GraphClient client; client.client_id = "63333333-209e-454e-b7bd-55a4d201270f"; client.tenant = "independentsoft.onmicrosoft.com"; client.username = "info@independentsoft.onmicrosoft.com"; client.password = "password"; User info = sync_wait(client.get_user("info@independentsoft.onmicrosoft.com")); User john = sync_wait(client.get_user("john@independentsoft.onmicrosoft.com")); JoinMeetingIdSettings joinMeetingIdSettings; joinMeetingIdSettings.is_passcode_required = true; CommunicationsIdentitySet organizerIdentity; organizerIdentity.user = CommunicationsUserIdentity(); organizerIdentity.user->display_name = "Info"; organizerIdentity.user->tenant_id = "independentsoft.onmicrosoft.com"; organizerIdentity.user->id = info.id; MeetingParticipantInfo organizer; organizer.identity = organizerIdentity; CommunicationsUserIdentity userJohn; userJohn.display_name = "John"; userJohn.tenant_id = "independentsoft.onmicrosoft.com"; userJohn.id = john.id; CommunicationsIdentitySet attendeeIdentity; attendeeIdentity.user = userJohn; MeetingParticipantInfo attendee; attendee.identity = attendeeIdentity; MeetingParticipants meetingParticipants; meetingParticipants.organizer = organizer; meetingParticipants.attendees.push_back(attendee); std::chrono::system_clock::time_point now = std::chrono::system_clock::now(); OnlineMeeting meeting; meeting.allowed_presenters = OnlineMeetingPresenters::Everyone; meeting.subject = "Online meeting XYZ"; meeting.start_time = now + std::chrono::hours(24); meeting.end_time = now + std::chrono::hours(24) + std::chrono::hours(2); OnlineMeeting createdOnlineMeeting = sync_wait(client.create_online_meeting(meeting)); if (createdOnlineMeeting.join_meeting_id_settings) { std::cout << "MeetingId = " << createdOnlineMeeting.join_meeting_id_settings->join_meeting_id << std::endl; std::cout << "Passcode = " << createdOnlineMeeting.join_meeting_id_settings->passcode << std::endl; } std::cout << "JoinWebUrl = " << createdOnlineMeeting.join_web_url << std::endl; } catch (const GraphException& ex) { std::cout << "Error: " << ex.code << std::endl; std::cout << "Message: " << ex.message << std::endl; } return 0; }
Need help? Ask our developers:
Name*
Email*
Message*