cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API v2 upload_session_finish with mode:update 400 error

API v2 upload_session_finish with mode:update 400 error

David W.152
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

David W.152
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 

 

 

David W.152
New member | Level 1

Well, so this works:

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

 

 

Greg-DB
Dropbox Staff

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.

David W.152
New member | Level 1

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

: )

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    David W.152 New member | Level 1
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?