'Rest API Pagination and multiple loops in Power query/Power BI

Background: I want extract all data from Rest API but the issue is that its URL provides data of 50 rows per ID. So far I've been able to create a function in Power query which allows me to extract all the AGENT-ID's,

PFB,

(id as text) as table=> let Source = Xml.Tables( Web.Contents( "https://vcc-na8.8x8.com", [RelativePath= "/api/stats/agents/" &(id)& "/activities?n="] ) ),

in source Than I invoked this function against the Agent id's column in new table and received al the id's with 50 rows.

Issue: It provides 50 rows per ID. I need to do a pagination in above function so that it gives me all of the rows with these all Id's.

PFB the API documentation.

URL: https://support.8x8.com/cloud-contact-center/virtual-contact-center/developers/8x8-contact-center-statistics-reporting-api#Testing_Using_A_Browser

Let me know if someone has the way to solve my problem.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source