Deleting Outlook Calendar Event In Workato

Workato Test 1 Reputation point
2021-09-16T17:02:03.757+00:00

I'm using a platform called Workato to manage some Outlook Calendar automations. The platform has calls like "new event" and "update event" built in, but if I want to delete an event I need to use a custom action. I'm using this endpoint to delete an event:

https://graph.microsoft.com/v1.0/me/events/{id}

When I make this call, I get this error:

401 Unauthorized: {"error":{"code":"InvalidAuthenticationToken","message":"Access token validation failure. Invalid audience.","innerError":{"date":"2021-09-16T05:12:44","request-id":"a042604a-2cff-45b0-a857-95a2558eb763","client-request-id":"a042604a-2cff-45b0-a857-95a2558eb763"}}}

Workato is managing my authorization via an in-app connector. The app has Calendar.readwrite persmissions. Am I making the wrong call? What do I need to do to get proper permissions? Any help would be appreciated, thanks.

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

1 answer

Sort by: Most helpful
  1. ShivaniRai-MSFT 2,726 Reputation points
    2022-03-10T11:47:18.097+00:00

    Hi @Workato Test ,

    As per the error message you have an invalid audience present in your access token. This error occurs when the access token is acquired for a given resource/API (which is MS graph in your case) but being consumed by different resource/API. You can check the audience by decoding access token using this https://jwt.io
    To call MS Graph APIs, audience must be set to https://graph.microsoft.com in access token.
    You can refer this similar MS Q&A post for more clarity https://learn.microsoft.com/en-us/answers/questions/513098/error-calling-user-invitation-api-httpsgraphmicros.html

    Hope this helps.

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

    0 comments No comments