Hi Asana Community,
I am requesting a bunch of project and getting the error “Your pagination token has expired” after approximately 20 minutes. I am connecting with the client like “client = asana.Client.access_token(ACCESS_TOKEN)” not setting any pagination options. Do you have any idea?
Hi @Niklas_Giesa, welcome to the forum!
When we began to use the api, we got the same problems.
Example: you query tasks for 2000 projects, but all your 2000 queries are in a queue, and after the first finish, ou request the next page. But, your next page of first response, is at position 2001. And, when you finally execute the query, the token is expired, because it can take very long time to get your results.
I don’t know if you call from a web browser, you can run around 5 query at the same time, they are queued by the XHR engine.
I suggest to push the next page first in line in your waiting queue, or loop all pages of project1, then all pages of project 2, …
But, when you have your response, you should immediately request page 2 and not wait for others to complete.
If you just query for page 1, and later, ask for page 2 from a “click” on a “show more” button, something like that, it will not work.
You should download all pages immediately if you need them all.
Just to be sure, the “ACCESS_TOKEN” is not the same as the pagination token.
they both expire, but access_token expire after 1 hour, and I think that it will auto-refresh by using the client.
The pagination token, is a token returned after 1 page of results, when you use the “limit=xx” parameter, that is used to query the next page.
This is the one you have troubles with.