Script to Get all assets, and assets on next page

My script can pull assets from 1-100, but how to I retrieve 101-200, and so on and so forth.

https://developer.atlassian.com/cloud/assetsapi/rest/api-group-assets/#api-asset-bulk-put

1 Like

Welcome to the Atlassian Developer Community, @afelts!

The link you provided points to Bulk create or update assets, by any chance are you referring to the Get all assets endpoint? With the assumption that you are, have you tried using the start query parameter to get the next page if isLastPage is not yet true? Something like,

GET /rest/assetapi/asset?start=100&limit=100

Hope this helps.

Ian

1 Like

Yes, but that didnt work for me. Seems like the script is staying on the same page? How do I go to the next page?

Hi @afelts ,

Can you share how you are getting the assets? Kindly share some snippets so that we can have a better understanding of how you are doing it, thanks.

I tried the following calls in my instance with 121 assets and it behaved as expected:

  • https://{myinstance}.atlassian.net/rest/assetapi/asset?start=0&limit=100 - results to page 1 with 100 assets and "isLastPage": false
  • https://{myinstance}.atlassian.net/rest/assetapi/asset?start=100&limit=100 - results to next page with the remaining assets; "size": 21 and "isLastPage": true

Cheers,
Ian

1 Like

Thanks, it worked. I just had an syntax error the first time.