Microsoft Graph Delta Endpoints | Query Only changes

Поділитися
Вставка
  • Опубліковано 26 жов 2024

КОМЕНТАРІ • 18

  • @daveinnes1695
    @daveinnes1695 2 роки тому +1

    explained perfectly! The amount of research i went thru just to hear this explained in a perfectly easy to understand way was too damn high..

  • @Salem309Y
    @Salem309Y 2 роки тому +2

    Thanks a lot for this explanation. It is perfect.

  • @iamravishank
    @iamravishank 4 роки тому +1

    At 07:42 you are copying nextLink value right? As far as i know nextLink denotes that there are other responses to be fetched in thials session. It is like pagination. The change that are done after the last api run will be fetched through deltaLink.?
    What am i missing here ?

    • @ConceptsWork
      @ConceptsWork  4 роки тому

      Whenever the first request is sent to delta endpoint, it will always return a next link, but the nextlink will always be a delta link, which is not the case with pagination.
      Pagination is limiting the amount of data that has to be send as a response, where delta link is creating a reference point on behalf of which, the differentiable or updated data is returned in the next request.
      Now lets say you trying to query an entity type, which as only 3 objects.
      Consider a tenant, where only three users exist in a directory.
      If you will query - graph.microsoft.com/v1.0/users, in this case there will no '@odata.nextlink' will be retured as response, becuase data payload is exceptionally small.
      But, if for the same tenant you will run delta query, you will get '@odata.nextlink' in response, but this time the value that you will receive in response will also have 'delta endpoint notations'.
      Let's say the first request is - graph.microsoft.com/v1.0/users/delta
      Now the response will be - "@odata.nextLink": "graph.microsoft.com/v1.0/users/delta?$skiptoken=MF1LuFYbK6Lw4DtZ4....
      But what we have to check is, $skiptoken value is a rational reference.
      Now this value that you are getting in response is the refernece point where you have to reach next time, so that the differential or updated data can be displayed as per the current attribute values or changes.
      Now lets say you send a get request to this delta endpoint, which we initally received in our '@odata.nextlink' value.
      This time the response will have a $deltatokenvalue instead of $skiptoken, becuase its an iterative request that has been made by application.
      @odata.deltaLink": "graph.microsoft.com/v1.0/users/delta?$deltatoken=MF1LuFYb....
      Steps to verify what I was trying to explain.
      Navigate to - graph.microsoft.com/v1.0/users/delta
      You will get '@odata.nextlink', which will have delta endpoint notations.
      Now before navigating to the link that you are getting in response, make change to any one user's attribute.
      And now navigate to '@odata.nextlink' url, you will see only the changes will be listed.

    • @RaviShankar-im9vv
      @RaviShankar-im9vv 4 роки тому

      ​@@ConceptsWork
      Then what is the exact difference between nextLink and deltaLink , if both of them are responsible for showing changed result ?

    • @ConceptsWork
      @ConceptsWork  4 роки тому

      They are not same.
      '@odata.nextlink' - This is used for pagination, wherein the reponse payload is divided into mutliple pages.
      '@odata.deltalink' - When you create a delta request for the first time for a specific object or for entire entity set, the current state is saved for rational reference. Next time when you reach the delta endpoint only the changes and the updates are sent in response.

    • @ConceptsWork
      @ConceptsWork  4 роки тому +1

      Delta links are opaque, service-generated links that the client uses to retrieve subsequent changes to a
      result.
      Delta links are based on a defining query that describes the set of results for which changes are being
      tracked; for example, the request that generated the results containing the delta link. The delta link
      encodes the collection of entities for which changes are being tracked, along with a starting point from
      which to track changes. OData services may use the reserved system query option $deltatoken when
      building delta links. Its content is opaque, service-specific, and must only follow the rules for URL query
      parts.

    • @iamravishank
      @iamravishank 4 роки тому

      @@ConceptsWork
      Liked your explanation,
      One more thing i wanted to ask.
      Suppose i and running api
      /Users/delta?$deltatoken=sbh12hshsy45...
      Now the response i will get can have some users info who have been newly added, some been deleted and some whose attributes values are changes (modified).
      The microsoft documentation says that the response will have @removed attribute to denote that thia particular user has been deleted. But no annotation for modified and newly added users.
      So ques is how to distinguish modified and newly added users from delta query response.
      Thanks

  • @ReniCalonge
    @ReniCalonge Рік тому

    how about deleted? how will you know if the records is deleted?

  • @doncoder-channel
    @doncoder-channel 4 роки тому

    Thanks for the video, can you do this with presence? I am trying but does not seem to work

    • @ConceptsWork
      @ConceptsWork  4 роки тому

      For presence the delta endpoint is not supported as of now, as there is no documentation.
      But if you will tell me the exact requirement, I may help.