Graph - CalendarView delta with deltaToken or skipToken returns a 403 forbidden with delegate permissions

Mickaël 10 Reputation points
2023-10-20T15:58:43.4933333+00:00

Hello,

I am encountering an issue with the Microsoft Graph API when attempting to use delegate permissions, specifically Calendars.ReadWrite and Calendars.ReadWrite.Shared, to interact with calendar events. I would appreciate your insights on this matter.

Here's the problem: I am currently building a synchronization feature between our application and a user's calendar. When I make a request to the calendarView/delta endpoint using delegate permissions, it works as expected, and I can retrieve calendar events and changes successfully. However, when I try to use the $deltaToken or $skipToken parameters to paginate through the results, I consistently receive a 403 error.

This issue does not occur when I use application permissions, but due to security considerations on the client side, we must stick to delegate permissions.

Has anyone else encountered this issue or found a solution to work with Calendars.ReadWrite and Calendars.ReadWrite.Shared delegate permissions while using the $deltaToken or $skipToken parameters?

Thank you in advance for your help!

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Diah.Karim-MSFT 335 Reputation points Microsoft External Staff
    2024-01-25T03:52:49.61+00:00

    Hi Mikael,

    I tried to simulate using MS Graph Explore and able to fetch the data with $skipToken

    Here are the steps:

    1. Sign in using M365 acc and call the endpoint. You will need to add in the request Header -> Prefer : odata.maxpagesize=2 for e.g https://graph.microsoft.com/v1.0/me/calendarView/delta?startDateTime=2023-12-01&endDateTime=2024-01-25 User's image
    2. Scroll to bottom result, and you will see the odata.nextlink. Copy the link and use it to next endpoint call to fetch the next result.
       "@odata.nextLink": "https://graph.microsoft.com/v1.0/me/calendarView/delta?$skiptoken=zlDCLFWGXWCu90TAtl8YaG0JQFQBAWaNEeCV_rhZ5db1Qgo0sa64FaBhgvtMlAvBOSx6ugWfkx7sQtdPsvCgbJQddDXwinsHFfoXEnPhExLMAQrp-gECd5DjhAxPIY63ghV4jqLuD8rnsQ638-6xGvryH4gjejGbzHd0sxljUuws-eGPUnmQDGkZLTwDNr6rsFoMM0qNAtBYJXFxI5ByzWtd5cQvm7BAOsajh6mz0Gw.23ywni6jY7MMBfLD9XzBCHK9zsO94S32urs7NZMdxeI"
       
    

    Hope this helps. If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".


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.