Rest API URL with offset & limit how to build pipeline fetching all data without duplication & all in one file

Shreyash Choudhary 126 Reputation points
2022-12-20T05:41:02.713+00:00

Hi all.
i have a scenario i have api url with offset & limit ,need to fetch all data in one single file without duplication, limit reamins same need to increase offset like 0 offset & limit 10 ,11 offset & limit 10,21 offset & limit 10 and so on,

there is no end condition in api as far i know how to build pipleline for this and how to increase offset and how to stop when api dont have data ,

i have gone through microsoft support docs but nothing usefull.

Api only send data and no header.

also one issue i noticed is i have a data column coming from rest api , that columns contains "A" or sometimes empty when i fetching data this column is not coming so i need to manualy map it in mapping, this is the problem /issue i faced

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,375 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,625 questions
0 comments No comments
{count} votes

Accepted answer
  1. MartinJaffer-MSFT 26,236 Reputation points
    2022-12-20T22:11:26.747+00:00

    Hello @Shreyash Choudhary ,
    Thanks for the question and using MS Q&A platform.

    As I understand, you need to use Copy Activity REST API connector, and want help with pagination. Your situation sounds just like this example, where each requests increments on fixed amount, and the stopping number is not known.

    272578-image.png

    My concern is an off-by-one error. By your example,

    offset | records retrieved  
    0 | 0,1,2,3,4,5,6,7,8,9,10 -- 11 records  
    11 | 11,12,13,14,15,16,17,18,19,20 -- 10 records  
    21 | 21,22,23,24,25,26,27,28,29,30 -- 10 records  
    

    did you mean offset should really start on 1?

    also one issue i noticed is i have a data column coming from rest api , that columns contains "A" or sometimes empty when i fetching data this column is not coming so i need to manualy map it in mapping, this is the problem /issue i faced

    I don't understand, could you please give a couple examples?

    Please do let me if you have any queries.

    Thanks
    Martin


    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
      • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

2 additional answers

Sort by: Most helpful
  1. Shreyash Choudhary 126 Reputation points
    2022-12-22T06:57:47.053+00:00

    Hi @MartinJaffer-MSFT ,
    thanks for the reply with so many details,

    sometime column has value, sometimes coming as null, when i previewed on source side it looks like what i provided above in 1st comment, now my question what to do use advanced editor and $ to put columns manually which are not coming to solve this issue? or something else

    when i provided without advanced editor i need to put columns manually and when i run the pipeline column 5 which i given in example which have sometimes small string and sometimes coming empty, that column is coming as full null means data loss.

    what should i do now??

    0 comments No comments

  2. Shreyash Choudhary 126 Reputation points
    2022-12-23T09:00:35.003+00:00

    Hi @MartinJaffer-MSFT ,

    What if API sends inconsistent data like if some columns don't have values, then Api didn't send that columns & in next records if Api have data means column does not null , in this case when i tried to do manual mapping of columns output file doesn't contain that column data.

    Problem is with Inconsistent Api data or anything else, facing data loss due to this!

    Thanks & regards
    Shreyash Choudhary


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.