Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

JSON - Pagination on Apigee Edge

Not applicable

Is it possible to do Pagination (of a JSON response) on Apigee Edge

For Example –

A backend – (that does not have any paging mechanism) - returns a JSON array of 200 items.

Can we store the response in a Cache - and then Query on the Cache – to return 10 items at a time.

(I have seen something similar done using XSL Transformation - in one of the cookbook examples, but it doesn't suggest anything for paging JSON responses.)

Solved Solved
0 7 3,195
1 ACCEPTED SOLUTION

Not applicable

So the way - I figured - I would do it is as follows : 1. Use LookUpCache

2. If LookUpCache fails - do a Service Callout (sync) -wait of it.

3. Populate Cache

4. LookUpCache again (store response in a variable)

5. Use a JavaScript policy - JSON parse the variable from LookUpCache

6. Use JSON Splice - (based on limit and offset - in queryparam)

7. Set response as the Spliced JSON.

This worked for my sample data; Please provide comments if this way can be used for pagination of a JSON response on Apigee Edge. Please let me know - any drawbacks to this approach, any modifications or better solutions.

View solution in original post

7 REPLIES 7