Forum Discussion

diegoSpace's avatar
diegoSpace
Brass Contributor
Apr 15, 2020

"The OData request is not supported" when creating an Event in Teams with Graph API

I am trying to create an event with Graph API from my Teams bot.

 

I get a token for my app with POST 

https://login.microsoftonline.com/{tenant ID}/oauth2/v2.0/token

 

The token is valid since I can use it for other purposes such as get Teams users:

https://graph.microsoft.com/v1.0/groups/{groupID}/members

 

Then I use this token (Bearer header) in a PUT

https://graph.microsoft.com/v1.0/users/{userId}/calendar/events

with an Azure userID in {userId} and an example event body

 

But I get an error response: "The OData request is not supported."

 

Any idea?

 

Thanks a lot,

Diego

  • Jennifer1988's avatar
    Jennifer1988
    Copper Contributor

    diegoSpace you need to user POST method instead of PUT. and the userId is your email address 。and the correct request is as below.

     
     

     

    the wrong demo is like :

     

     

    • diegoSpace's avatar
      diegoSpace
      Brass Contributor

      Trinetra-MSFT Sorry, I got a problem responding in that thread and I started a new thread, but then I forgot to remove this thread. I wanted to remove it now but I can not see how... Sorry again

    • AspCom's avatar
      AspCom
      Copper Contributor

      Trinetra-MSFT I find it rather arrogant to point out a duplicate post without linking to the original. I find myself in a similar position as the OP and this is now a dead-end.

Resources