Issue
I am getting an error while combining requests in one HTTP call for Graph APIs. I had followed the official document from Here
this is the error I am getting,
Steps:
- Loading all Microsoft team chats for logged-in user
- Iterate 20 request and call batch APIs
- Getting "InvalidRequest" error
What is the possible way to resolve this issue?
Please provide suggestions.
Solution
One of the workaround you may follow :
Based on the given MS DOC
we have tried with microsoft graph api and tested successfully.
We have tried the given MS DOC example with below request body ;
{
"requests": [
{
"id": "1",
"method": "GET",
"url": "/me/drive/root:/{file}:/content"
},
{
"id": "2",
"method": "GET",
"url": "/me/planner/tasks"
},
{
"id": "3",
"method": "GET",
"url": "/groups/{id}/events"
},
{
"id": "4",
"url": "/me",
"method": "PATCH",
"body": {
"city": "Redmond"
},
"headers": {
"Content-Type": "application/json"
}
}
]
}
In request header we have added the key value and run the query as below:
NOTE:- Make sure that you have formatted correctly in your request body while making an API call.
For more information please refer the below links:-
- MS DOC| Batch Size limitation
- SO THREAD|400 Bad Request with MS Graph when adding list items , List private team channel members with Microsoft Graph API
Answered By - AjayKumarGhose
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.