cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1020
Views
5
Helpful
1
Replies

UCCX rest API json path problem

MikeHoliday
Level 1
Level 1
I have a problem with a JSON document.
I have a rest API where I get a response that is OK and is the same as the one below:
{
"customerId": 187459,
"benefits": [
{
"benefitId": 16,
"benefitEarnId": 639729,
"benefitType": "COUNTABLE_BENEFIT",
"benefitFor": "GROUP",
"benefitTitle": "Gold",
"benefitDescription": "",
"benefitLongDescription": "",
"benefitImage": "",
"decimalQuantity": false,
"earned": 368,
"burned": 215,
"balance": 153,
"exclusiveBenefitEl": false,
"exclusiveBenefitElGroup": false,
"userFriendlyTitle": "Gold"
}
]
}
I like to get balance.
When I make a GET JSOn document and with the json path (I tested it at https://jsonpath.com/? Where I get OK response) - "benefits[*].balance" I only get blank. However, if I get a response from the rest API, the output is normal, so as if I'm using the wrong json path, what advice?
1 Accepted Solution

Accepted Solutions

Anthony Holloway
Cisco Employee
Cisco Employee

Your JSONPath didn't work for me either.  Try this:

 

$.benefits[0].balance

As you can see below, it works (UCCX 11.6(2)):

uccx-json-balance.png

View solution in original post

1 Reply 1

Anthony Holloway
Cisco Employee
Cisco Employee

Your JSONPath didn't work for me either.  Try this:

 

$.benefits[0].balance

As you can see below, it works (UCCX 11.6(2)):

uccx-json-balance.png