You can follow below to copy all pages from the rest Api into the SQL database:
Create a pipeline and run web activity to retrieve the details of Api as below:
![enter image description here](https://cdn.statically.io/img/i.imgur.com/6N8vWS0.png)
After successful execution of pipeline web activity will retrieve the details of Rest Api, create linked service of Rest Api for source and SQL database linked service for sink. Add foreach activity on success of web activity, add below range function as items for foreach activity:
@range(1,activity('restAPI').output.total_pages)
Inside the for each activity add copy activity, Create Rest Api dataset with dataset parameter rurl
with value @dataset().rurl
by using created linked service, add it as source of copy activity and set get activity as request method and add value ?page=@{item()}
for rurl
as shown below:
![enter image description here](https://cdn.statically.io/img/i.imgur.com/koVTXKX.png)
Create SQL database dataset with dataset parameter tablename
for table by using created linked service, add it to sink with value Apipage@{item()}
tablename
and enable auto create table. Mapp the data according to the requirements. Debug the pipeline and it will execute successfully. The data is copied successfully as shown bellow:
![enter image description here](https://cdn.statically.io/img/i.imgur.com/j8lB6L1.png)
In sample rest Api there are two pages that's why created 2 tables with complete data.