CA API Gateway: Combining multiple JSON sources

Document ID : KB000100619
Last Modified Date : 11/06/2018
Show Technical Document Details
Through separate transactions you receive back two JSON payloads

i.e: Your have two REST endpoints that return a list of users

Endpoint 1:
{"user1":"Joe","user2":"Alec", "user3":"Matt"}

Endpoint 2:
{"user4":"Bill","user5":"Mo", "user6":"Greg"}

You would now like to use policy to combine the two groups of users into one JSON document.
While there are several options available for this use case we have seen increased performance from using RegEx.
A sample policy is attached showing how to concatenate the JSON while using RegEx to cleanup the JSON characters.

File Attachments: