Mateusz Makowski
Mateusz Makowski

Reputation: 53

Graph Delta API for groups returning 400 "Resource not found for the segment 'contacts'."

I develop an integration with Azure Ad which supports incremental synchronisations of users and groups. It worked fine for quite a long time, but recently some (not all) of my customers started encountering one specific error. For a request like:

GET https://graph.microsoft.com/v1.0/groups/delta?$skiptoken=<TOKEN_FROM_PREVIOUS_SYNCRHONISATION>

The API returns a response with status code 400 and body:

   "error": {
    "code": "BadRequest",
    "message": "Resource not found for the segment 'contacts'.",
    "innerError": {
      "request-id": "<SOME-REQUEST-ID>",
      "date": "2019-02-27T20:01:16"
    }
  }

I want to point out that this error occurs for some specific customers and I was not able to reproduce it on my environment. Could someone give me a hint or two what could be causing this error?

Upvotes: 4

Views: 1071

Answers (3)

Mateusz Makowski
Mateusz Makowski

Reputation: 53

After couple of days, my customers stopped raising the issue, so I believe the problem was temporary and on Azure side.

Upvotes: 0

Flaviu Mureșan
Flaviu Mureșan

Reputation: 51

I have the exact same problem when I send a request to the following endpoint

GET https://graph.microsoft.com/v1.0/groups/delta?$select=id,displayName,description&$expand=members

However, it works if I remove the "$expand=members" parameter from the URI. Could that be what's causing it in your case too?

Upvotes: 1

juunas
juunas

Reputation: 58723

Make sure you are using skip tokens and delta tokens correctly.

You should only have a skip token when you get the next page of a delta response.

Later when you want to get changes, you have to use a delta token. So $deltaToken instead of $skipToken.

Like the delta link here: https://learn.microsoft.com/en-us/graph/delta-query-events?view=graph-rest-1.0#sample-third-and-final-response

Upvotes: 1

Related Questions