Skip to content

How to use $deltatoken=latest with version 6? #2498

Open

Description

According to https://learn.microsoft.com/en-us/graph/delta-query-overview, you can use $deltatoken=latest to start tracking changes from "now". How do I do this with the SDK version 6.54.0?

Activity

  1. added
    status:waiting-for-triage
    on Oct 16, 2025
  2. wimdeblauwe commented on Oct 17, 2025

    @wimdeblauwe
    Author

    It does not seem like the SDK currently support this, but I managed to write this workaround.

    First create a subclass of DeltaRequestBuilder in order to be able to set urlTemplate:

    import com.microsoft.graph.users.delta.DeltaRequestBuilder;
    import com.microsoft.kiota.RequestAdapter;
    import java.util.HashMap;
    
    public class MyDeltaRequestBuilder extends DeltaRequestBuilder {
    
      public MyDeltaRequestBuilder(
          HashMap<String, Object> pathParameters,
          RequestAdapter requestAdapter) {
        super(pathParameters, requestAdapter);
      }
    
      public void setUrlTemplate(String urlTemplate) {
        this.urlTemplate = urlTemplate;
      }
    }

    Then you can do this to the delta of the Entra Id users starting from "now":

          MyDeltaRequestBuilder delta = new MyDeltaRequestBuilder(new HashMap<>(), graphClient.getRequestAdapter());
          delta.setUrlTemplate("{+baseurl}/users/delta()?$deltaToken=latest");
          RequestInformation getRequestInformation = delta.toGetRequestInformation();
          DeltaGetResponse deltaGetResponse = graphClient.getRequestAdapter()
              .send(getRequestInformation, null, DeltaGetResponse::createFromDiscriminatorValue);
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:waiting-for-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions