get_temporary_upload_link

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

gettemporaryupload_link

scope: files.content.write

Get a one-time use temporary upload link to upload a file to a Dropbox location.

This endpoint acts as a delayed upload. The returned temporary upload link may be used to make a POST request with the data to be uploaded. The upload will then be perfomed with the CommitInfo previously provided to get_temporary_upload_link but evaluated only upon consumption. Hence, errors stemming from invalid CommitInfo with respect to the state of the user's Dropbox will only be communicated at consumption time. Additionally, these errors are surfaced as generic HTTP 409 Conflict responses, potentially hiding issue details. The maximum temporary upload link duration is 4 hours. Upon consumption or expiration, a new link will have to be generated. Multiple links may exist for a specific upload path at any given time.

The POST request on the temporary upload link must have its Content-Type set to application/octet-stream.

Example temporary upload link consumption request:

curl -X POST https://content.dropboxapi.com/apitul/1/bNi2uIYF51cVBND --header Content-Type: application/octet-stream --data-binary @local_file.txt

A successful temporary upload link consumption request returns the content hash of the uploaded data in JSON format.

Example succesful temporary upload link consumption response: {content-hash: 599d71033d700ac892a0e48fa61b125d2f5994}

An unsuccessful temporary upload link consumption request returns any of the following status codes:

HTTP 400 Bad Request: Content-Type is not one of application/octet-stream and text/plain or request is invalid. HTTP 409 Conflict: The temporary upload link does not exist or is currently unavailable, the upload failed, or another error happened. HTTP 410 Gone: The temporary upload link is expired or consumed.

Example unsuccessful temporary upload link consumption response: Temporary upload link has been recently consumed.

Request Body

{"commit_info"=>{"path"=>"/Homework/math/Matrices.txt", "mode"=>"add", "autorename"=>true, "mute"=>false, "strict_conflict"=>false}, "duration"=>3600}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
Dropbox-API-Path-Rootstring
Dropbox-API-Select-Userstring

RESPONSES

status: OK

{"link":"https://content.dropboxapi.com/apitul/1/bNi2uIYF51cVBND"}