error I encountered while attempting to create an online meeting using the Microsoft Graph API

Jaykumar Gohil 0 Reputation points
2023-04-21T09:40:30.8666667+00:00

I am writing to request your assistance in resolving an error I encountered while attempting to create an online meeting using the Microsoft Graph API. The error message I received is as follows: "Error creating online meeting: GraphError: Request payload cannot be null." I am providing you with the necessary information related to the error message: Data passed in body is as below:

{
	subject: 'Test Meeting',
	startDateTime: { dateTime: '2023-04-21T10:28:53.061Z', timeZone: 'UTC' },
	endDateTime: { dateTime: '2023-04-21T11:28:53.061Z', timeZone: 'UTC' },
	attendees: [
		{ emailAddress: [Object], type: 'required' },
		{ emailAddress: [Object], type: 'optional' }
	]
}

Code snippet I used is:

const onlineMeeting = 
{
	subject: 'Test Meeting',
	startDateTime: {
		dateTime: new Date(new Date().getTime() + 3600000).toISOString(),
		timeZone: 'UTC'
	},
	endDateTime: {
		dateTime: new Date(new Date().getTime() + (3600000 * 2)).toISOString(),
		timeZone: 'UTC'
	},
	attendees: [
		{
			emailAddress: {
				address: 'kishan.raval@yopmail.io',
				name: 'Kishan Raval'
			},
			type: 'required'
		},
		{
			emailAddress: {
				address: 'jane.doe@yopmail.com',
				name: 'Jane Doe'
			},
			type: 'optional'
		}
	]
};

client.api('/me/onlineMeetings')
.post(onlineMeeting)
.then((response) => {
	console.log(Online meeting created with id: ${response.id});
})
.catch((error) => {
	console.error('Error creating online meeting: ', error);
});

Please let me know if there is any additional information that you require to help me resolve this issue. I appreciate your prompt attention to this matter. User's image

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,593 questions
{count} votes

3 answers

Sort by: Most helpful
  1. HarmeetSingh7172 4,811 Reputation points
    2023-04-21T12:22:05.39+00:00

    Hello Jaykumar Gohil,

    Thanks for reaching out!

    It seems there is an issue with the request body you are passing. I'm successfully able to create an OnlineMeeting with below properties in my request body.

    POST https://graph.microsoft.com/v1.0/me/onlineMeetings  
    {  
        "subject": "My event",  
        "startDateTime": "2023-05-06T16:30:34.2444915-07:00",  
        "endDateTime": "2023-05-06T17:00:34.2464912-07:00",  
        "participants": {  
            "organizer": {  
                "identity": {  
                    "user": {  
                        "id": "f09fd4f8-90f8-4088-ad78-38d45cbf3f1a"  
                    }  
                }  
            }  
        },  
        "isBroadcast": true,  
        "broadcastSettings": {  
            "allowedAudience": "organization",  
            "isRecordingEnabled": true,  
            "isAttendeeReportEnabled": true  
        },  
        "recordAutomatically": false,  
        "allowAttendeeToEnableCamera": true,  
        "allowAttendeeToEnableMic": true,  
        "allowMeetingChat": "enabled",  
        "allowTeamworkReactions": true,  
        "isEntryExitAnnounced": false  
    }  
    

    Please note that the startDateTime and endDateTime properties describes the meeting start time and end Time in UTC respectively. There is no such property like 'timeZone' for request body.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.


  2. Saurav Keshri 0 Reputation points
    2024-03-28T09:48:11.7966667+00:00

    @HarmeetSingh7172 I am trying the same thing with the token which has the OnlineMeetings.ReadWrite scope and i am getting below error

     "code": "BadRequest",
     "message": "15000: An error has occurred.",
    
    

    Any idea why this may come ?

    0 comments No comments

  3. Saurav Keshri 0 Reputation points
    2024-03-28T09:48:27.98+00:00

    @HarmeetSingh7172 I am trying the same thing with the token which has the OnlineMeetings.ReadWrite scope and i am getting below error

     "code": "BadRequest",
     "message": "15000: An error has occurred.",
    
    

    Any idea why this may come ?

    0 comments No comments