Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
David W.152
10 years agoNew member | Level 1
API v2 upload_session_finish with mode:update 400 error
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
Replies have been turned off for this discussion
- David W.15210 years agoNew 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.15210 years agoNew member | Level 1
Well, so this works:
"mode": {".tag": "update", "update": "xxxx"}
- Greg-DB10 years ago
Dropbox Community Moderator
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.15210 years agoNew member | Level 1
You'll need a little bit more luck to work smoothly with API v2.
: )
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!