Getting 504 error from /checklists Endpoint
Asked by hp:

Hello Community,

We are collecting data for all checklists present in all the boards. So, we are collecting all the boards from "/boards" endpoint and for all the boards, we are collecting the respective checklists using "/boards/board-id-1/checklists" endpoint.

But recently we are facing 504 errors during these API Calls. Is it an issue from Trello's side or we are doing something wrong here?

The error we are encountering:

*** ** * ** ***

"504 Server Error: Gateway Timeout for URL: [https://api.trello.com/1/boards/my-board-id/checklists?fields=all\&checkItem_fields=all](https://api.trello.com/1/boards/my-board-id/checklists?fields=all&checkItem_fields=all)"

*** ** * ** ***

Thanks.


Answers:
author: Felix
body: Hey [@hp](/t5/user/viewprofilepage/user-id/4742729)

Likely what's going on here is that your board has a lot of checklists, and it's taking Trello longer than the time allowed (30 seconds) to process and return them. Technically, this is something we need to fix. We don't use this API internally in our clients, so it's not optimized for large boards at this point.

I would suggest in the meantime you switch to a different API call, that lets you paginate through cards and checklists on those cards - this should enable you to get all checklists from a board (albeit requires writing more logic).

A call like api.trello.com/1/boards/\<my-board-id\>/cards?fields=\&checklists=all\&limit=100\&since=\<last-seen-card-id\> should get you what you need

Felix

comments: author: hp
body: Thank you [@Felix](/t5/user/viewprofilepage/user-id/853253) for the response.

We have tried updating this call, but we have 2 points:

1. The **limit** param for pagination is not working for this endpoint: "/boards/board-id-1/checklists". If any other pagination mechanism is available, then it would be helpful
2. In the current API Call: "<https://api.trello.com/1/boards/my-board-id/checklists>?**fields=all\&checkItem_fields=all**". Due to the fields params, we are getting all the fields, but with this change, we are not getting any of this extra fields, only basic fields are included in **checklists** key for **cards** records.  
   Example of response from old API "/boards/board-id-1/checklists":

   *** ** * ** ***

   {  
   "checkItems": \[\],  
   "id": "my-Checklist-ID-1",  
   "name": "Checklist 1",  
   "idBoard": "my-board-1",  
   "idCard": "my-Card-ID-10",  
   "pos": 16381.0,  
   "limits": {  
   "checkItems": {  
   "perChecklist": {  
   "status": "ok",  
   "disableAt": 200,  
   "warnAt": 160  
   }  
   }  
   },  
   "creationMethod": null  
   }

   *** ** * ** ***

   Example of response from your suggested API change:

   *** ** * ** ***

   {  
   "id": "my-Card-ID-10",  
   ...,  
   "idChecklists": \[  
   "my-Checklist-ID-1",  
   "my-Checklist-ID-2"  
   \],  
   "checklists": \[  
   {  
   "name": "Checklist 1",  
   "idBoard": "my-board-1",  
   "idCard": "my-Card-ID-10",  
   "pos": 16381.0,  
   "id": "my-Checklist-ID-1",  
   "checkItems": \[\]  
   },  
   {  
   "name": "Checklist 2",  
   "idBoard": "my-board-1",  
   "idCard": "my-Card-ID-10",  
   "pos": 16382.0,  
   "id": "my-Checklist-ID-2",  
   "checkItems": \[\]  
   }  
   \]  
   }  

   *** ** * ** ***

   Is there any way to get all the fields of **checklists** from "/cards" endpoint.


author: Felix
body: 1. Yes, the \`/checklists\` endpoint doesn't support pagination currently

2. Looks like you're just missing \`limits\`? I don't think that's currently available via the \`/cards\` route. Same with \`creationMethod\` - also currently not available.

Why do you need these fields?