Hello all,
I'm working with the Schoox API (Schoox API Docs) to pull data from our LMS, and I'm running into a challenge with pagination. Here’s what I’m trying to do:
Get Learning Paths: First, I make an API call to retrieve a list of all Learning Paths, which gives me their IDs. Here’s the API for that:
https://api.schoox.com/v1/dashboard/curriculums?role=employee&apikey=9d3419535b0c8d76f7f6f72800f62f92&acadId=226581108
(API Docs: Learning Paths)
Get Enrolled Users for Each Learning Path: For each Learning Path ID, I need to make a second API call to fetch all users enrolled in that Learning Path. Here’s the API for that:
https://api.schoox.com/v1/dashboard/curriculums/{id}?role=employee&apikey=9d3419535b0c8d76f7f6f72800f62f92&acadId=226581108&limit=1000
(API Docs: Enrolled Users)
The Challenge:
- The second API call (which retrieves users) only returns 1000 users at a time. I need to retrieve all users for each Learning Path, which means I need to implement pagination.
- The pagination is handled by incrementing a start parameter for each set of 1000 users.
Issue with Iterative Macro:
- I tried using an Iterative Macro in Alteryx to handle pagination, but since the API requires two dynamic inputs (Learning Path ID and the start parameter for pagination), I’m struggling to make it iterate correctly. The macro only processes one iteration and then stops, without pulling all the data.
I’m new to macros in Alteryx, so I’m unsure how to correctly structure this. Could someone guide me on how to set up the iterative macro to loop through the start parameter until all users are retrieved for each Learning Path? Do I need to use a Batch macro instead - if yes how will the logic work?
Any help would be appreciated!
Thanks!