question

AdityaAranya-2691 avatar image
0 Votes"
AdityaAranya-2691 asked SathyamoorthyVijayakumar-MSFT answered

Pagination error invalid token for Rest API Data Factory

Hi,

I am trying to use rest api to do pagination as it is just sending the first page in Azure ADF going to blob storage. I am currently using AbsoluteUrl and $['@odata.nextLink'] to get over all the pages, the issue is I am getting this error, I have used first used the token activity to get the token and then used it in copy activity where the source is rest api dataset with headers dynamically coming from token activity and then used pagination. Can you point me in the right direction on if this is the correct approach or am I missing something.

![143201-image.png][1]


azure-data-factorypartner-center-api
image.png (31.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

SathyamoorthyVijayakumar-MSFT avatar image
0 Votes"
SathyamoorthyVijayakumar-MSFT answered

Hello @AdityaAranya-2691,

Thanks for the question and using MS Q&A platform.

If I understand correctly. the copy activity fails - when the pagination happens.

If there is a long duration for copy activity - for first iteration to complete. There is a possibility the token getting expired before the second request.

This is causing a 401 - authentication issue.

Note :
You could quickly check your token here - https://jwt.ms - decoded.

145773-image.png

The expiry is in epoch, and you could convert the epoch time here. See whether the error is happening after this time.



image.png (31.2 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @AdityaAranya-2691,

Following up to see if the above suggestion was helpful. And, if you have any further query do let us know

0 Votes 0 ·