Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
Graph JS
>
Tutorial
> Create online meeting
The following example shows you how to create an online meeting.
import { GraphClient } from '../independentsoft/graph/graph.js'; import { JoinMeetingIdSettings, CommunicationsIdentitySet, MeetingParticipantInfo, CommunicationsUserIdentity, MeetingParticipants, OnlineMeeting, OnlineMeetingPresenters} from '../independentsoft/graph/teams.js'; async function mainFunc() { try { const client = new GraphClient(); client.clientId = "xxxxxxxxxx-209e-454e-xxxxxxxxxxxxxxxxxxx"; client.tenant = "independentsoft.onmicrosoft.com"; client.username = "info@independentsoft.onmicrosoft.com"; client.password = "password"; const info = await client.getUser("info@independentsoft.onmicrosoft.com"); const john = await client.getUser("rade@independentsoft.onmicrosoft.com"); let joinMeetingIdSettings = new JoinMeetingIdSettings(); joinMeetingIdSettings.isPasscodeRequired = true; let organizerIdentity = new CommunicationsIdentitySet(); organizerIdentity.user = new CommunicationsUserIdentity(); organizerIdentity.user.displayName = "Info"; organizerIdentity.user.tenantId = "independentsoft.onmicrosoft.com"; organizerIdentity.user.id = info.Id; let organizer = new MeetingParticipantInfo(); organizer.identity = organizerIdentity; let userJohn = new CommunicationsUserIdentity(); userJohn.displayName = "John"; userJohn.tenantId = "independentsoft.onmicrosoft.com"; userJohn.id = john.id; let attendeeIdentity = new CommunicationsIdentitySet(); attendeeIdentity.user = userJohn; let attendee = new MeetingParticipantInfo(); attendee.identity = attendeeIdentity; let meetingParticipants = new MeetingParticipants(); meetingParticipants.organizer = organizer; meetingParticipants.attendees.push(attendee); const now = new Date(); const start = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 16, 0, 0); const end = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 17, 0, 0); let meeting = new OnlineMeeting(); meeting.allowedPresenters = OnlineMeetingPresenters.EVERYONE; meeting.subject = "Online meeting XYZ"; meeting.startTime = start; meeting.rndTime = end; const createdOnlineMeeting = await client.createOnlineMeeting(meeting); console.log("MeetingId = " + createdOnlineMeeting.joinMeetingIdSettings.poinMeetingId); console.log("Passcode = " + createdOnlineMeeting.joinMeetingIdSettings.passcode); console.log("JoinWebUrl = " + createdOnlineMeeting.joinWebUrl); } catch (e) { console.error(e.code) //error code console.error(e.message) //description console.error(e.date) //timestamp console.error(e.innerError) //innerError } } mainFunc();
Need help? Ask our developers:
Name*
Email*
Message*