Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
DavidM27
6 years agoExplorer | Level 4
Uploading multiple files with UploadSession with TypeScript
Hi, I'm facing an issue with the UploadSessionFinishBatch method with TypeScript. I'm having this error : Error in call to API function \"files/upload_session/finish_batch\": request body: entries...
- 6 years ago
Thanks for writing this up! This does seem to be a bug in the SDK. The UploadSessionFinishArg type has a 'contents' field because it's how you supply the data if/when calling filesUploadSessionFinish (not the batch version), where it gets set as the request body, but it's not actually needed or expected for filesUploadSessionFinishBatch. I'll ask the team to fix this up.
Similarly, in this case you should just be setting the file data on UploadSessionStartArg itself, not UploadSessionCursor or CommitInfo. Those definitions are also wrong, so I'll ask the team to fix that too.
As a workaround though, it looks like you can do the following after defining each of these:
delete cursor.contents delete commitInfo.contents delete finishSessionArg.contents
Greg-DB
Dropbox Community Moderator
6 years agoThanks for writing this up! This does seem to be a bug in the SDK. The UploadSessionFinishArg type has a 'contents' field because it's how you supply the data if/when calling filesUploadSessionFinish (not the batch version), where it gets set as the request body, but it's not actually needed or expected for filesUploadSessionFinishBatch. I'll ask the team to fix this up.
Similarly, in this case you should just be setting the file data on UploadSessionStartArg itself, not UploadSessionCursor or CommitInfo. Those definitions are also wrong, so I'll ask the team to fix that too.
As a workaround though, it looks like you can do the following after defining each of these:
delete cursor.contents delete commitInfo.contents delete finishSessionArg.contents
DavidM27
6 years agoExplorer | Level 4
Thank you, for your reply it does work as a workaround. Can you please keep me informed when this is fixed ?
- Greg-DB6 years ago
Dropbox Community Moderator
Yes, I'll follow up here once I have an update on this. I can't promise when that will be though.
- Greg-DB5 years ago
Dropbox Community Moderator
The team has updated the SDK to no longer set 'contents' as required in the latest JavaScript SDK version, v9.7.0, so you should be able to use this as expected without the workaround now.
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!