ca api policy manager

191 Views Asked by At

I am new in the CA API policy manager and I want to create an API in policy manager. Which assertion is used in the API policy manager? Make an API If I passed Mayank in the JSON format it should return me ur Surname

Request - {"name":"Mayank"}

Response - {"surname":"Agarwal"}

Likewise Request - {"name":"Yash"}

Response - {"surname":"Dhoni"}

If the name is not Mayank or Yash then send a response

{"error":"name not found"}

2

There are 2 best solutions below

0
On

Here i have to use Evaluate JSON assertion that will fetch the JSON value.

1
On

Use Policy assertions in which you use At least one assertion must evaluate true and then use All assertion must evaluate true in which you can use error thing as well.