Forum Discussion
Create a Teams calendar event from a bot
diegoSpace , Do you have required Calendar.ReadWrite permission in your access token? You can check that on jwt.io.
Trinetra-MSFT Thanks for your response, on jwt.io I could see my permissions, and there was no permission for Calendar. I added it in my app (Azure) and then retried:
"roles": [
"User.ReadWrite.All",
"Group.Read.All",
"Directory.ReadWrite.All",
"Directory.Read.All",
"User.Read.All",
"GroupMember.Read.All",
"Calendars.ReadWrite"
],
But with that token I still have the error:
"The OData request is not supported."
Is "Calendars.ReadWrite" permission the only required? It is without '.All' (like the others), I have not found the '.All' one...
My raw request is:
PUT /v1.0/users/bcb3f5a......23a5925/calendar/events HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1Q.....EUquw
Host: graph.microsoft.com
Content-Type: application/json
Content-Length: 548
{
"subject": "Let's go for lunch",
"body": {
"contentType": "HTML",
"content": "Does late morning work for you?"
},
"start": {
"dateTime": "2020-04-15T12:00:00",
"timeZone": "Europe/Madrid"
},
"end": {
"dateTime": "2020-04-15T14:00:00",
"timeZone": "Europe/Madrid"
},
"location":{
"displayName":"Harry's Bar"
},
"attendees": [
{
"emailAddress": {
"address":"samanthab@contoso.onmicrosoft.com",
"name": "Samantha Booth"
},
"type": "required"
}
]
}
Thanks a lot,
Diego