Some useful Dropbox API requests

These are some Dropbox API requests that I have tested and found working:

Get Access token

POST https://api.dropbox.com/oauth2/token?grant_type=refresh_token&refresh_token=<REFRESH_TOKEN>&client_secret=<CLIENT_SECRET>

Use the refresh token generated through the Dropbox API app. Since the refresh token has an expiry of up to a few months it can be reused to generate an access token.

Get a temporary link to the file

To generate Dropbox file links with a limited expiry time. This is a secure way if you want to generate a temporary link.

POST https://api.dropboxapi.com/2/files/get_temporary_link

Body: {“path”:<RELATIVE_PATH_INSIDE_DROPBOX>}

Headers:

Dropbox-API-Path-Root: { “.tag”: “root”, “root”: <ROOT_FOLDER_ID_FROM_DROPBOX_APP> }

Authorization: Bearer <ACCESS_TOKEN>

Download a file

POST https://content.dropboxapi.com/2/files/download

Headers

Authorization: Bearer <ACCESS_TOKEN>

Dropbox-API-Arg: {“path”:<RELATIVE_PATH>}

Dropbox-API-Path-Root: { “.tag”: “root”, “root”: <ROOT_FOLDER_ID_FROM_DROPBOX_APP> }

Leave a comment

Your email address will not be published. Required fields are marked *