I am trying to make a REST call using Call studio REST Client to an endpoint. However, in my json response, i get multiple values.
Although, i could see all the responses in the log, my requirement is to utilize only 1 response.
As per documentation, it looks like i can achieve the same outcome using json expression but it doesnt work.
Example my response id looks like this:
Now, i just need to store value of id in one of the session data. However, current response_body stores the entire response.
My xpath/json path looks like this : /item/id
Set your path to $.item. and you should then be able to reference the data via Data.Element.<element-name>.id
If you only need the one field, then you could set the XPath in the Rest
Client element to $.item.id and you'll end with Element Data named 'id'
(it'll be named whatever the final thing is that you've asked for and is
most-likely case sensitive).
by the way, XPath uses slashes but JSON Path expressions use $ and dots.