0

Is there any way to pass response object values from first request to second request as input parameters in graph batch request (2nd request is dependant on 1st request - graph/json-batching)

In the following request, the client is specifying that requests 1 should be run first, then request 2. 2nd Request need the id from the 1st Request's response as URL variable. What is the way to achieve it?

JSON

{
  "requests": [
    {
      "id": "1",
      "method": "GET",
      "url": "/users/<upn>?$select=id"
    },
    {
      "id": "2",
      "dependsOn": [ "1" ],
      "method": "GET",
      "URL": "users/<id from the 1st request>/presence"
    }
  ]
}
  • Hi John, the information that you provided here is not enough. Could you specify your solution? That would bring better understanding to how you make requests. – Farrukh Normuradov Feb 06 '21 at 20:32
  • According to the [doc](https://learn.microsoft.com/en-us/graph/json-batching#request-format), I think it's impossible to achieve it. – Tiny Wang Feb 07 '21 at 15:46
  • If my answer is helpful, please accept it as answer by clicking the check mark so that it could be helpful to others who has the same question. – Shiva Keshav Varma Feb 08 '21 at 05:26

1 Answers1

0

Yes, As @Tiny-wa said this is not possible as of now. There is already a feature request raised in the Microsoft Graph Feedback Forum, please upvote it so that the product team may implement it in future.

So, for now you need to make two separate requests, make first request and get response details and use it and make a second request.

Shiva Keshav Varma
  • 3,398
  • 2
  • 9
  • 13