View Single Post
Old 09-13-2023, 06:39 PM   #22
allanahk
Connoisseur
allanahk ought to be getting tired of karma fortunes by now.allanahk ought to be getting tired of karma fortunes by now.allanahk ought to be getting tired of karma fortunes by now.allanahk ought to be getting tired of karma fortunes by now.allanahk ought to be getting tired of karma fortunes by now.allanahk ought to be getting tired of karma fortunes by now.allanahk ought to be getting tired of karma fortunes by now.allanahk ought to be getting tired of karma fortunes by now.allanahk ought to be getting tired of karma fortunes by now.allanahk ought to be getting tired of karma fortunes by now.allanahk ought to be getting tired of karma fortunes by now.
 
allanahk's Avatar
 
Posts: 71
Karma: 2202292
Join Date: Nov 2018
Device: Kobo Libra 2
I finally got this working! I used to download books via the native Dropbox integration on kobo, but that required exiting and restarting KOreader each time. This is much faster

Some hurdles that I ran into that might help others:

1. The curl command is slightly different for windows terminal (replace \ with ^):

Code:
curl https://api.dropbox.com/oauth2/token ^
-d code=AUTHORIZATION_CODE ^
-d grant_type=authorization_code ^
-u APP_KEY:APP_SECRET
2. Make sure you have files.metadata.read and files.content.read ticked under permissions (I think these are the only ones needed but I selected all read permissions just in case), and remember to press submit so that the permissions save. Only generate the refresh token after doing this. I have the app is restricted to a single folder, so it's not necessary to allow full access to your entire Dropbox (or write permissions, unless you want them)

3. To double check that you have the correct scope for your refresh token, when you run the curl command in terminal, check the "scope" parameter contain your chosen permissions (it will appear in the same output as the refresh token). For some reason my permissions didn't stick the first time and I was generating a token with only account_info.read, leading to a lot of frustration and confusion

4. Update to the latest KOReader version and check the crash log if things aren't working - it's more informative now and very useful when things go wrong, like when you have insufficient permissions or the wrong tokens etc
allanahk is offline   Reply With Quote