Hello Влад Луценко,
Thank you for contacting Microsoft!
Regarding the header Prefer: respond-async, below work arounds might help in making the header work for the requests.
- Ensure each request in the batch should be a separate object within the
requests
array. - 429 error usually indicates that you are hitting rate limits, this could be due to too many requests in a short period. Try adding delay between requests or using exponential backoff to handle rate limiting.
- Since you are using
Prefer: respond-async
ensure your client is correctly handling asynchronous responses. You might need to implement a mechanism to poll for the status of the batch request until it's completed.
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.