"Requested too many cards with action loads, please limit"

Hi,

I’m trying to fetch the cards in a list, with the card comments, like this:

 curl "https://api.trello.com/1/lists/{list_id}/cards
       ?actions=commentCard&action_fields=data&actions_limit=5
       &key={key}&token={token}"

For one particular list, I get back the an error:

{
  "message":"Requested too many cards with action loads, please limit",
  "error":"API_TOO_MANY_CARDS_REQUESTED"
}

Is there anything I can do, or am I obliged to get the list’s cards without comments, and then get the comments for each individual card? I’d have hoped the actions_limit might have helped, but it doesn’t.

Update 1:
I already use the batch mechanism to fetch multiple lists at a time … I’ll explore using it to get multiple cards at a time

Update 2:
I decided to fix this by adding a limit=500 when fetching the cards … this is for my Apple Watch app, and I can’t see people realistically scrolling through many cards on the watch. If/when I implement search this might become important again.

Do you have a canonical sync example anywhere, that makes full use of batch fetching, since, etc? Evernote have this and it is very handy, even if it just a textual description of a full initial sync, and then later incremental syncs.

This is the correct thing to do. Using the since and before parameters, you can continue to page through results to get everything. There is a brief mention of paging here: https://developers.trello.com/docs/api-introduction#section-paging

It is also worth mentioning that if you’re trying to do a sync (that is, grab the current state of a Trello board and then only get stuff that has changed) the cards_modifiedSince on the cards nested resource may be useful to you. It accepts a timestamp or an ID.

:sweat_smile:Not yet!

1 Like