cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
10985
Views
37
Helpful
30
Replies

JSON Response from REST Client CVP 11.5

dmehta
Level 1
Level 1

Hi Team,

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:

{

  "item": {

   "id": 123,

   "url": "https://{subdomain}.zendesk.com/api/v2/items/123.json",

   "name": "Wibble",

   ...

   "created_at": "2012-04-04T09:14:57Z"

  }

}

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


Please help.


30 Replies 30

Got this working with help from Paul  and Janine

 

var pathExpression = "$.accounts[?(@.accountNumber=='1234567890')].accountName"

 

The quotes did the trick.

 

Regards