All of the official client libraries implement pagination internally; you shouldn’t have to use any code to do that yourself. The call should return all tasks in the project automatically.
Confirming with @Bastien_Siebman - you use the Node library, right? It handles all pagination itself, yes?
We are trying to get all the tasks form a Project Template, then create a project from that template. Sometimes it bring all tasks, and sometimes it shows the above error and it miss some tasks.
Afraid I’m not of much more help - it looks specific to the Node library which I don’t use. I do know @Bastien_Siebman uses it, though, and I don’t think has had any issues retrieving all tasks?
@Lamine_B how is your internet connection? We had DNS and connection problems a while ago and then we had similar errors in nodejs (ENOTFOUND).
Back then we did a quite dirty fix and simply iterated over one task until it was received in full (with a while loop). It worked, but as soon as internet got better, the errors vanished.
There is a rate limit but it’s not necessarily 15 per minute; it’s much more complex than that and depends on a number of factors. It’s all explained here:
FYI the correct way to handle Asana rate limits is not just to add a timeout; that may well work but will be less efficient and take longer than necessary. The correct way is explained in the API docs:
To protect the stability of the API and keep it available to all users, Asana enforces multiple kinds of rate limiting. Requests that hit any of our rate limits will receive a 429 Too Many Requests response, which contains the standard Retry-After header indicating how many seconds the client should wait before retrying the request.
As it says, the proper way to handle it is to catch a 429 exception, read the Retry-After header value, and wait that number of seconds.
I stumbled upon this thread again. I have the “Cannot create Collection from response that does not have resources” error in my logs, and trying to investigate why…