May 12 2021 09:18 PM
Error "UnableToDeserializePostBody" when trying to create calendar event(Microsoft Teams) through Outlook 1.0 API
Hi Team,
I am trying to create a microsoft teams meeting using graph API(post).
I have used Post request(v1.0) to a url : https://graph.microsoft.com/v1.0/me/events and I am using "application/json" as content type .
But, when I triggered the url, It is throwing me an 400 error :"code": "UnableToDeserializePostBody".
I have provided all the details in the body like :attendees,starttime,endtime and also below parameters.
"isOnlineMeeting": "True",
"onlineMeetingProvider": "teamsForBusiness"
Please kindly help me to resolve this issue!
May 16 2021 07:11 PM
Hi @livecid7692b37964fb, could you please verify the create event document and consent all application level permissions.
May 18 2021 12:42 AM
May 19 2021 09:18 PM
May 19 2021 09:30 PM
May 19 2021 09:33 PM
May 20 2021 11:27 PM
yes sure,
Here is my code,
var token = "token..."
var newEvent = {
"Subject": "Title of Event",
"Body": {
"ContentType": "HTML",
"Content": "Description of Event",
},
"Start": {
"DateTime": "2021-05-26 20:35",
"TimeZone": "UTC"
},
"End": {
"DateTime": "2021-05-26 20:35",
"TimeZone":"UTC"
},
"Attendees": [
{
"EmailAddress": {
"Address": "xyz@gmail.com",
"Name": "Dummy Name"
},
"Type": "Required"
}
],
'IsOnlineMeeting': true,
'onlineMeetingProvider': 'teamsForBusiness' //teamsForBusiness, skypeForConsumer
};
// Pass the user's email address
var userInfo = {
email: "abc@gmail.com", // organiser Email
name: "ABC" // organiser Name
};
outlook.calendar.createEvent({token: token, event: newEvent, user: userInfo},
function(error, result){
if (error) {
callback(error,null);
}
else if (result) {
callback(null,result);
}
});
Here is Response
error: 'REST request returned 400; body: {"error":{"code":"UnableToDeserializePostBody","message":"were unable to deserialize "}}'
Please help..
Thanks..
May 25 2021 04:55 AM
May 26 2021 01:57 PM
May 26 2021 09:10 PM