Graph API V1.0: The logic for updating events doesn't seem to match my parameter expectations.

Xiong Rui 5 Reputation points
2024-03-29T09:56:04.48+00:00

Step 1: Created an event through the Graph API: /me/calendars/{calendar_id}/events. Request Body:

{

Creation Result: Created successfully, and successfully obtained the event ID and joinUrl in the onlineMeeting property.

Step 2: Modified the start and end time of the event and updated the event through the Graph API: /me/calendars/{calendar_id}/events/{event_id}. Request Body:

{

Update Result: The update API call was successful, but I found that the onlineMeeting property in the response body is now empty. Upon checking the meeting in Teams, I found that it was no longer an online meeting.

Step 3: Modified the start and end time of the event again and updated the event through the Graph API: /me/calendars/{calendar_id}/events/{event_id}. Request Body:

{

Update Result: The update API call was successful again. Interestingly, I was able to retrieve the event ID and joinUrl from the onlineMeeting property once more. This time, the meeting in Teams was also restored to a normal online meeting.

Does anyone know why such unexpected results occurred, especially in the second step? Could it be an issue with my parameters?

Any assistance would be greatly appreciated.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,022 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Xiong Rui 5 Reputation points
    2024-03-29T09:58:25.3733333+00:00
    >>>>>>>>>>>>>>>>>>>step1 json 
    {
    		'subject': 'Onsite-Account Manager-13:00-13:30-Roy Tan',
    		'body': {
    		'contentType': 'HTML',
    		'content': '\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n </head>\n <body style="font-family: Arial, sans-serif;">\n <p><h2> online meeting</h2></p>\n </body>\n </html>\n '
    		},
    		'start': {
    			'dateTime': '2024-04-04 13:00:00',
    			'timeZone': 'Asia/Shanghai'
    		},
    		'end': {
    			'dateTime': '2024-04-04 13:30:00',
    			'timeZone': 'Asia/Shanghai'
    		},
    		'attendees': [{
    			'emailAddress': {
    				'address': 'abc@email.com'
    			},
    			'type': 'required'
    		}],
    		'isOnlineMeeting': True,
    		'onlineMeetingProvider': 'teamsForBusiness'
    	}	
    >>>>>>>>>>>>>>>>>>>step2 json 
    {
    		'subject': 'Onsite-Account Manager-13:00-13:30-Roy Tan',
    		'body': {
    		'contentType': 'HTML',
    		'content': '\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n </head>\n <body style="font-family: Arial, sans-serif;">\n <p><h2> online meeting</h2></p>\n </body>\n </html>\n '
    		},
    		'start': {
    			'dateTime': '2024-04-04 16:00:00',
    			'timeZone': 'Asia/Shanghai'
    		},
    		'end': {
    			'dateTime': '2024-04-04 16:30:00',
    			'timeZone': 'Asia/Shanghai'
    		},
    		'attendees': [{
    			'emailAddress': {
    				'address': 'abc@email.com'
    			},
    			'type': 'required'
    		}],
    		'isOnlineMeeting': True,
    		'onlineMeetingProvider': 'teamsForBusiness'
    	}
    >>>>>>>>>>>>>>>>>>>step3 json 
    {
    		'subject': 'Onsite-Account Manager-13:00-13:30-Roy Tan',
    		'body': {
    		'contentType': 'HTML',
    		'content': '\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n </head>\n <body style="font-family: Arial, sans-serif;">\n <p><h2> online meeting</h2></p>\n </body>\n </html>\n '
    		},
    		'start': {
    			'dateTime': '2024-04-04 16:00:00',
    			'timeZone': 'Asia/Shanghai'
    		},
    		'end': {
    			'dateTime': '2024-04-04 16:30:00',
    			'timeZone': 'Asia/Shanghai'
    		},
    		'attendees': [{
    			'emailAddress': {
    				'address': 'abc@email.com'
    			},
    			'type': 'required'
    		}],
    		'isOnlineMeeting': True,
    		'onlineMeetingProvider': 'teamsForBusiness'
    	}		
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.