Share via

Graph API: 400 bad request - Error authenticating with resource

Bram Bertels 0 Reputation points
2024-10-23T03:05:24.6+00:00

When trying to execute the following API call

/teams/<team id>/schedule/shifts

I sometimes get the error: "Error authenticating with resource" together with a 400 bad request

This happens about 22x per day and multiple queries fail around the same few minutes.

I query this about once every 5 minutes so that's about 300 calls per day en about 22 of them fail.

The queries are always the same and they are working most of the time

Calls to other graph api's keep working all the time

Microsoft Security | Microsoft Graph
0 comments No comments

1 answer

Sort by: Most helpful
  1. Rajat Vashistha-MSFT 1,780 Reputation points
    2024-12-27T09:38:10.2166667+00:00

    Hi Bram Bertels,

    Thank you for reaching out to Microsoft!

    The error "Error authenticating with resource" along with a 400 bad request typically indicates a problem with the authentication token or the way the request is being made. Here are a few steps you can take to troubleshoot and potentially resolve this issue:

    1. Token Expiry: Ensure that the authentication token you're using is not expired. Tokens have a limited lifespan and need to be refreshed periodically.
    2. Rate Limiting: Although you mentioned that the calls are made every 5 minutes, it's worth checking if there are any rate limiting policies in place that might be causing some of the requests to fail.

    Additionally, you mentioned that other Graph APIs are working fine. Please note that there are throttling limits per tenant as well, so it would be helpful to check if you are not exceeding them.

    https://learn.microsoft.com/en-us/graph/throttling-limits

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.