Hello All,
I have a requirement that with a call to an apigee end point with a different proxy name sent in header, the result should be the list of client id’s of all the apps where the products that proxyname sent in the header are part of.
So let say I have proxy 1 and proxy2. Proxy 1 is part of Product1 and Product1 is part of App1 and App2. Now when I call Proxy2 using postman with Proxy1 name sent in header, the output should be some thing like below
{
“app”: [
{
“appId”: “****”,
“attributes”: [
{
“name”: “DisplayName”,
“value”: “App1”
},
“credentials”: [
{
“apiProducts”: [
{
“apiproduct”: “Product1”,
“status”: “approved”
}
],
“attributes”: ,
“consumerKey”: “",
“consumerSecret”: "”,
}
{
“appId”: “****”,
“attributes”: [
{
“name”: “DisplayName”,
“value”: “App2”
},
“credentials”: [
{
“apiProducts”: [
{
“apiproduct”: “Product1”,
“status”: “approved”
}
],
“attributes”: ,
“consumerKey”: “",
“consumerSecret”: "”,
}
I tried developing the process where I get the list of all apps using the management api call trough a javascript. But I am not able to filter the all apps json response I get from the management api call to get the desired result I mentioned above.
Lets say I store the all apps response in the variable FinalList. I try to get the desired output using the below message template but it just shows and nothing else.
extracted-text BADDBEEF {jsonPath($.app[*].credentials[?@.apiProducts[?@.apiproduct == 'Product1']],FinalList,'true')}Any suggestion or help is highly appreciated.
Thanks