How to configure Pagination in REST Source ADF Copy data activity with end cursors in the response?

Abhinav Gundapaneni 56 Reputation points Microsoft Employee
2023-02-13T07:29:52.7233333+00:00

I have an ADF pipeline with a REST Datasource which pulls data from an API. The way pagination is currently working in this API is, for every page, the response contains a "pagination" field in the body which has 2 fields - hasNextPage (boolean) and endCursor (GUID).

I was able to set the EndCondition parameter correctly, but I am facing issues while setting up the QueryParameters. The URL to get to the next page should contain the "endCursor" value of the previous page. What is the best way to solve this?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,623 questions
0 comments No comments
{count} votes

Accepted answer
  1. MartinJaffer-MSFT 26,236 Reputation points
    2023-02-14T01:26:57.1833333+00:00

    @Abhinav Gundapaneni Hello and welcome to Microsoft Q&A.

    When the pagination passes you a full or partial url like:

    https://MySite.net/api/table/pages/3
    or
    /table/pages/3
    

    then you should use the "absoluteURL" pagination rule.

    If the pagination is meant as a url parameter like

    statehash=f4sdh5
    in
    https://MySite.net/api/queryresults?statehash=f4sdh5
    

    then you should use the "QueryParameters" pagination rule. The Name value would be "statehash" and since you get the cursorEnd from the body, choose "Body" and "pagination.cursorEnd" queryparameter rule

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.