Microsoft Graph API receiving 400 UnknownError when getting second page of delta query

Theo Lukens 10 Reputation points
2025-04-10T15:35:31.5133333+00:00

The Microsoft Graph API consistently returns 400 Bad Request with body "UnknownError" when querying for the second page of a paginated delta query.

I'm calling the GET /users/{id | user-principal-name}/chats/getAllMessages/delta endpoint documented here.

The initial request returns a @odata.nextLink URL which I then use in a subsequent request. This request works and I get another @odata.nextLink URL, but this one consistently fails with the error above.

Any help debugging this would be much appreciated!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,541 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Carolyne-3676 291 Reputation points
    2025-04-23T05:20:53.8233333+00:00

    Hello Theo!
    Thanks for reaching out.
    This error suggests that there might be an issue with the request or the data being returned.
    Here are a couple of troubleshooting steps:

    Token Expiry: Ensure that the token you're using for the request hasn't expired. If it has, you'll need to obtain a new one.

    1. Incorrect URL: There might be an error in the URL you're using for the second request. Ensure that the @odata.nextLink URL you received from the first request is being used correctly such that there are no modifications. URL encoding can sometimes cause problem hence copying and pasting the URL into a text editor that shows hidden characters can help identify any issue
    2. Inspect the Request Headers: Verify that the request headers for the subsequent request are correctly set. Ensure that you are including any necessary headers such as Authorization.
    3. Retry Logic: Implement retry logic with exponential backoff to handle transient issues.
    4. Token Expiry: Ensure that the token you're using for the request hasn't expired. If it has, you'll need to obtain a new one.

    Try and capture the logs and if this persists, please share the correlation ID and timestamp details for investigation.


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.