Microsoft Graph API - How to fetch delta for drives using timestamp in Java?

Sagar Gole 0 Reputation points
2024-07-10T06:58:53.0633333+00:00

When trying to fetch delta items using the "drives/{drive-id}/delta?token=timestamp" API in Java, the token query parameter is not available in requestConfiguration object. This API is working in graph explorer, but not supported in Java implementation. How can I fetch delta using timestamp in Java?MS-Graph-Delta-API

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,767 questions
OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
1,055 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Carolyne-3676 211 Reputation points
    2024-07-17T09:59:54.84+00:00

    Hello Sagar!
    The workaround is to override the url being used using the withUrl method. It will look something like this:

    var result = graphClient.drives().byDriveId("{drive-id}").items().byDriveItemId("{driveItem-id}").delta().withUrl("https://graph.microsoft.com/v1.0/drives/{drive-id}/delta?token=timestamp").get();

    0 comments No comments

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.