cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

API v2 upload_session_finish with mode:update 400 error

New member | Level 1
New member | Level 1

app permission type: App folder

API version: dropbox API v2

description: API "upload_session_finish" with mode:update error

------

Have no idea how the "update mode" works (how it works with "rev" param?).

Thanks for your help!

 

screen_shot_01:

 

screen_shot_02:

--------------

Console logs:

curl -X POST https://content.dropboxapi.com/2-beta-2/files/upload_session/finish --header 'Authorization: Bearer <token>' --header 'Content-Type: application/octet-stream' --header 'Dropbox-API-Arg: {"cursor":{"session_id":"<session_id>","offset":14659},"commit":{"path":"/test_upload2.png","mode":"update"}}'

Error in call to API function "files/upload_session/finish": HTTP header "Dropbox-API-Arg": commit.mode: expected object for 'update', got symbol

 -------------

curl -X POST https://content.dropboxapi.com/2-beta-2/files/upload_session/finish --header 'Authorization: Bearer <token>' --header 'Content-Type: application/octet-stream' --header 'Dropbox-API-Arg: {"cursor":{"session_id":"<session_id>","offset":14659},"commit":{"path":"/test_upload2.png","mode":"update", "rev": "xxxx"}}'

Error in call to API function "files/upload_session/finish": HTTP header "Dropbox-API-Arg": commit: unknown field 'rev'

 -------------

curl -X POST https://content.dropboxapi.com/2-beta-2/files/upload_session/finish --header 'Authorization: Bearer <token>' --header 'Content-Type: application/octet-stream' --header 'Dropbox-API-Arg: {"cursor":{"session_id":"<session_id>","offset":14659},"commit":{"path":"/test_upload2.png","mode":"update"}, "rev": "xxxx"}'

Error in call to API function "files/upload_session/finish": HTTP header "Dropbox-API-Arg": unknown field 'rev'

 

 

4 Replies 4
Highlighted

Re: API v2 upload_session_finish with mode:update 400 error

New member | Level 1
New member | Level 1

curl -X POST https://content.dropboxapi.com/2-beta-2/files/upload_session/finish --header 'Authorization: Bearer <token>' --header 'Content-Type: application/octet-stream' --header 'Dropbox-API-Arg: {"cursor":{"session_id":"<session_id>","offset":1048576},"commit":{"path":"/test_upload2.png","mode": {"update": "aaa"}}}'

Error in call to API function "files/upload_session/finish": HTTP header "Dropbox-API-Arg": commit.mode: missing '.tag' key

----------

curl -X POST https://content.dropboxapi.com/2-beta-2/files/upload_session/finish --header 'Authorization: Bearer <token>' --header 'Content-Type: application/octet-stream' --header 'Dropbox-API-Arg: {"cursor":{"session_id":"<session_id>","offset":1048576},"commit":{"path":"/test_upload2.png","mode": {"update": "aaa", ".tag": "rev"}}}'

Error in call to API function "files/upload_session/finish": HTTP header "Dropbox-API-Arg": commit.mode: unknown tag 'rev'

-----------

Could you show me the document of this API?

But not this one: https://www.dropbox.com/developers/documentation/http#documentation-files-upload_session-finish 

 

 

Highlighted

Re: API v2 upload_session_finish with mode:update 400 error

New member | Level 1
New member | Level 1

Well, so this works:

"mode": {".tag": "update", "update": "xxxx"}

 

 

Highlighted

Re: API v2 upload_session_finish with mode:update 400 error

Dropboxer
Dropboxer

Hi David, apologies that the documentation and explorer aren't clear on how to use that. I'll send that along as feedback to get that fixed up. I'm glad to see you sorted this out already though.

Highlighted

Re: API v2 upload_session_finish with mode:update 400 error

New member | Level 1
New member | Level 1

You'll need a little bit more luck to work smoothly with API v2.

: )

 

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?