Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question - setting a Co-host in OnlineMeeting #1834

Closed
ccea-dev-team opened this issue Feb 19, 2024 · 2 comments
Closed

Question - setting a Co-host in OnlineMeeting #1834

ccea-dev-team opened this issue Feb 19, 2024 · 2 comments
Assignees

Comments

@ccea-dev-team
Copy link

Hi,

I don't a stackoverflow account so cannot post there.

I'm using the MS Graph API with Java and I have a question about creating an online meeting with a cohost.

I can create the Event fine using the Event object, along with attendees which is part of the Event object, but I want to set 1 of the attendees as a co-host.

The process for this is very convoluted. It seems I cannot do this through the Event object but have to get the OnlineMeeting object and set one of the MeetingParticipentsInfo as co-host.

My question is how do I do this? How do I get the OnlineMeeting object using the Event object data?

So far I have this - but I don't think this will work. Is the event id the same as the OnlineMeeting id? What is the correct way of doing this and would it not be easier to allow direct access to the OnlineMeeting through the Event object?

     Event newEvent = graphClient.users().byUserId(emailOfMeetingOwner).events().post(event, requestConfiguration -> {
        requestConfiguration.headers.add("Prefer", OUTLOOK_TIMEZONE);
    });
	
	if(meetingCohost != null)
	{		
		OnlineMeeting meeting =   graphClient.users().byUserId(emailOfMeetingOwner).onlineMeetings().byOnlineMeetingId(newEvent.getId()).get();
		
		for(MeetingParticipantInfo meetingPar : meeting.getParticipants().getAttendees())
		{
			if(meetingPar.getUpn().equals(meetingCohost))
			{
				meetingPar.setRole(OnlineMeetingRole.Coorganizer);
			}
		}
	}
@ccea-dev-team
Copy link
Author

Or should I just use the OnlineMeeting endpoint instead of Event? If I do this will it create the same thing as the Event does? i.e. an entry in the users calendar and send an email invite to all the attendees?

@Ndiritu
Copy link
Contributor

Ndiritu commented Feb 19, 2024

Hi @ccea-dev-team
I think you'll need to create an OnlineMeeting first with the participants (including setting the co-host). Then using the joinWebUrl to create an Event with isOnlineMeetingEnabled and the onlineMeeting property populated.

In case this doesn't work, I'd kindly request that you engage with the support team via https://learn.microsoft.com/en-us/answers/questions/ask/ as this is not an issue with the SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants