Getting 400 Bad Request while calling Microsoft Graph API by using Custom Request template

0
C I am trying to hit a POST method - https://graph.microsoft.com/v1.0/$batch by using Custom request Template (given the template below) but I am getting 400 bad request. But the same API is working in Postman. Custom request template is as below: requests[] r=    url=/users('xyz')/photos/48x48/$value    method=GET    id=xyz above model is creating using http://www.objgen.com/json?demo=true - which will give the JSON - {   "requests": [     {       "url": "/users('xyz')/photos/48x48/$value",       "method": "GET",       "id": "xyz"     }   ] }
asked
1 answers
0

Hi Mohammed

put another ‘{‘ on the first line of your request body.

It should look like this:

{{
  "requests": [
    {
      "url": "/users('xyz')/photos/48x48/$value",
      "method": "GET",
      "id": "xyz"
    }
  ]
}

Hope this solves the problem :)

Kind regards,

Ömer

answered