Missing API for fetching all cards in a custom column #2596
Replies: 2 comments
Maybe I am misinterpreting the issue, but currently you can return the column metadata and custom cards by column, maybe this has already been addressed, or maybe you were unaware that you need to prepend '/1' to the url. The url's that I believe you are looking for The column metadata url above returns html view of just that column and append .json returns the metadata for that column In that column metadata there is a attribute "cards_url" this contain you can go to and admittedly this will return a 404, but if you append .json to it all of the cards will show up in json. However... this is limited to only the columns that you have added to the board so anything in Maybe, Done, or Not Now is not included. You can see my discussion on this here. |
|
Yes, things have changed since the original report. Specifically: e422d5b implements the /boards/<board_id>/columns/<column_id>/cards.json URL that was not available back in February when this issue was opened. But as you note the #3017 the distinction between custom columns and built-in columns referenced by name/ID makes it barely useful as an API since any caller need to branch on the type of column when trying to fetch all cards... :( Fetch all cards in built-in column: /cards?board_ids[]=BOARD_ID&indexed_by=maybe Neither query works for columns of the other type afaict... But I guess technically this is done now. |
Uh oh!
There was an error while loading. Please reload this page.
As far as I can tell there is currently no API support for fetching all cards in a column - existing API clients (e.g. fizzy-cli) are forced to fetch all cards on a board and then filter client side when the column desired is not one of the built-in "indexed_by values: https://github.com/robzolkos/fizzy-cli/blob/master/internal/commands/card.go#L138
Looking at the code seems to confirm that the /cards API endpoint only supports the indexed_by values listed in the scope at https://github.com/basecamp/fizzy/blob/main/app/models/card.rb#L28
There is a separate /boards/BOARD_ID/columns/COLUMN_ID endpoint which the UI uses to fetch the HTML for a specific column, and which correctly renders the column-specific list of cards, but unfortunately for the JSON API it only returns the column metadata itself per: https://github.com/basecamp/fizzy/blob/main/app/views/boards/columns/show.json.jbuilder
In addition to just being inefficient to have to fetch ALL cards for a board in order to get the list of cards for a specific column, it seems very untidy to have the HTML/JSON results on the /boards/BOARD_ID/columns/COLUMN_ID show endpoint differ so dramatically!
My suggestion/request:
Thoughts?
All reactions