sillfishes
sillfishes

Reputation: 390

Is there a way to export an entire Trello board as JSON via API?

I'm trying to compare Trello boards in order to highlight differences. You can easily download a board in JSON format from Trello by replacing the board's name with ".json" in the url:

http://trello.com/b/board_id_here.json

This requires you to be authenticated with Trello, however. Is there a way to get this exact JSON output directly out of the Trello API? There are ways of getting each of the child objects from the API, but I don't see a way to extract an entire JSON representation of the board and everything related to it.

Any help greatly appreciated!

Upvotes: 14

Views: 4251

Answers (1)

Aaron Dufour
Aaron Dufour

Reputation: 17535

That backup route is just a synonym for GETting /1/boards/board_id_here with the following parameters:

fields: "all"
actions: "all"
action_fields: "all"
actions_limit: 1000
cards: "all"
card_fields: "all"
card_attachments: true
labels: "all"
lists: "all"
list_fields: "all"
members: "all"
member_fields: "all"
checklists: "all"
checklist_fields: "all"
organization: false

Summing everything up in a cURL request*:

curl --location --request GET 'https://api.trello.com/1/boards/{{ BOARD_ID }}/?filters=all&actions=all&action_fields=all&actions_limit=1000&cards=all&card_fields=all&card_attachments=true&labels=all&lists=all&list_fields=all&members=all&member_fields=all&checklists=all&checklist_fields=all&organization=false' \
--header 'Content-Type: application/json' \
--data '{
  "key": "{{ KEY }}",
  "token": "{{ TOKEN }}"
}'
  • You can easily import and execute this request in POSTMAN: First, replace the 3 {{ dynamic }} variables with the Board ID, API KEY and TOKEN, then go to Import > Raw Text then paste the code above and execute.

Upvotes: 7

Related Questions