Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

Background

Given a URL to a Trello board, as listed at the users main Trello page, it used to be possible to deduce the URL for the corresponding "Export JSON" link.

I wrote up the way I did this in this answer:

You can also just add .json (or /somename.json) to the end of a board or card URL, to get the prompt to save the downloaded file (e.g. https://trello.com/board/welcome-board/4e6a8095efa69909ba007382/somename.json)

One really nice thing about this was that the default name for the saved file was then somename.json, which was useful when you had lots of files to download.

I put all this together in a JavaScript bookmarklet, that allowed me to download all my Trello boards with just a few clicks (and the aid of a Browser add-on.) The README in that project has more info on how to use it.

Recent Change

However, some time since my last backup on 6th July 2013, the URLs on the Trello main page have changed, so now:

There is text in the Export link (4d5ea62fd76aa1136000000c) that is not present in the board link, meaning the above deduction no longer works.

Question

Without using the Trello API, given a link to board on Trello.com, how can I deduce a link to download the JSON export, ensuring that the output filename is of the same human-readable form as given in the url (hyphen-separated, lower case)

The reason I say "without using the Trello API" is that the API adds an extra step for users, namely the need to get a Developer Key, which seems to me to be an unnecessary hurdle, for just exporting data - and I'd like to avoid that, if at all possible.

share|improve this question
    
I also found trello-backup, which is an existing api-based mechanism that can be run with cron jobs, and is much simpler to user than the JavaScript I set up. (I haven't tested it out, though) –  Clare Macrae Jul 31 '13 at 21:21

1 Answer 1

First of all, fixing it so that just adding .json to the end of the url is on our to-do list, so you could just wait for that to be fixed. However...

If you take a url like

https://trello.com/b/<id>/<slug>

and turn it into a url like

https://trello.com/1/boards/<id>?fields=all&actions=all&action_fields=all&actions_limit=1000&cards=all&card_fields=all&card_attachments=true&lists=all&list_fields=all&members=all&member_fields=all&checklists=all&checklist_fields=all&organization=false

then you will get the same as adding .json used to do. This will make an api call, but GET api requests can be authenticated with just the cookie that is stored in your browser, so this will go through without a developer key.

share|improve this answer
    
Thanks for the info. The api-based url does download from the 8-char slug, which is great. However, the output file is named <slug> rather than <id>.json. Is it possible to specify the output filename via the url, please? –  Clare Macrae Jul 31 '13 at 7:29
    
@ClareMacrae Not that I know of, because that's a browser behavior, not something that we're doing on the server. –  Aaron Dufour Jul 31 '13 at 16:59
    
Oh dear. I will see if I can find the "fix adding of .json to end of URL" on the Trello dev board, to vote for it, then! Thanks for the info, anyway. –  Clare Macrae Jul 31 '13 at 19:01
    
As a workaround, I've made my JavaScript also write out sets of lines beginning rename and mv, which the user can execute, to get meaningful file names. It's hacky, but it works. –  Clare Macrae Jul 31 '13 at 21:23
    
@ClareMacrae Having done a little more research, it looks like the following: davidwalsh.name/download-attribute will help you (for most modern browsers, at least). Use a tag like <a href=link download=filename> to specify the file name. –  Aaron Dufour Jul 31 '13 at 23:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.