Prefer: respond-async header doesn't work at microsoft graph api

Влад Луценко 0 Reputation points
2024-12-24T18:53:36.3966667+00:00

I'm trying to use microsoft graph api to make CRUD operations with excel files on onedrive.
As far as there is no way to update multiple non-adjacent ctlls in single request I'm tryung to use Prefer: respond-async header in my batch request.

const response = await this.client
  .api('/$batch')
  .header('Prefer', 'respond-async')
  .header('workbook-session-id', this.sessionId)
  .post({ requests: batchRequests });

but instead of getting 202 response, I'm waiting till my requests will be resolved and most of them (4/6) are failed with 429 error.

Need help to find the answer is there any way to update data in multiple non-adjusent cells or how should I use "prefer: respond-async" header so it would work for my requests.

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

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.