You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
varunvyas5678
3 years agoExplorer | Level 3
Error : POST https://content.dropboxapi.com/2/files/upload_session/append_v2 400 (Bad Request)
Getting error while appending blobs to session using 'https://content.dropboxapi.com/2/files/upload_session/append_v2' in Salesforce LWC JS:
uploadFile(event){
var file = eve...
Greg-DB
3 years agoDropbox Staff
Make sure you check the response body itself. It should contain a more specific error indicating what the issue is.
- varunvyas56783 years agoExplorer | Level 3
Response for the callout is:
Error in call to API function "files/upload_session/append:2": The given OAuth 2 access token is malformed.- Greg-DB3 years agoDropbox Staff
That error message indicates that there's an issue with the access token value you're supplying with the API call. Check the access token you're sending and make sure you're using the exact value as it was provided to you by Dropbox. Don't add or remove any characters, make sure there's no stray whitespace, etc. (As a matter of security, do not share any access tokens or refresh tokens here.)
- varunvyas56783 years agoExplorer | Level 3
Hi Greg, I looked into it and got to know that am not getting the Session_Id in the response of upload_session/start callout. So I tried hitting it with the following snippet:
return fetch('https://content.dropboxapi.com/2/files/upload_session/start', {"method": "post","headers": {"Authorization" : "Bearer "+dropboxToken,"Content-Type": "application/octet-stream","Dropbox-API-Arg": "{\"close\":false}"},"body": file}).then((httpResponse) => {console.log('Response:',httpResponse);if (httpResponse.ok){console.log("HTTP RES : OK")return httpResponse.ok} else {console.log("HTTP RES : NOT OK")return !httpResponse.ok}}).catch(err => console.log("[ERROR] UPLOAD_SESSION_FINISH : " + err));
And even after status code of 200 am not getting any Session_Id, This is the response am getting:- Response {type: 'cors', url: 'https://content.dropboxapi.com/2/files/upload_session/start', redirected: false, status: 200, ok: true, …}
- body: ReadableStream
- bodyUsed: false
- headers: Headers {}
- ok: true
- redirected: false
- status: 200
- statusText: "OK"
- type: "cors"
- url: "https://content.dropboxapi.com/2/files/upload_session/start"
- [[Prototype]]: Response
- arrayBuffer: ƒ arrayBuffer()
- blob: ƒ blob()
- length: 0
- name: "blob"
- arguments: (...)
- caller: (...)
- [[Prototype]]: ƒ ()
- [[Scopes]]: Scopes[0]
- body: (...)
- bodyUsed: (...)
- clone: ƒ clone()
- length: 0
- name: "clone"
- arguments: (...)
- caller: (...)
- [[Prototype]]: ƒ ()
- [[Scopes]]: Scopes[0]
- formData: ƒ formData()
- length: 0
- name: "formData"
- arguments: (...)
- caller: (...)
- [[Prototype]]: ƒ ()
- [[Scopes]]: Scopes[0]
- headers: (...)
- json: ƒ json()
- ok: (...)
- redirected: (...)
- status: (...)
- statusText: (...)
- text: ƒ text()
- type: (...)
- url: (...)
- constructor: ƒ Response()
- Symbol(Symbol.toStringTag): "Response"
- get body: ƒ body()
- get bodyUsed: ƒ bodyUsed()
- get headers: ƒ headers()
- get ok: ƒ ok()
- get redirected: ƒ redirected()
- get status: ƒ status()
- get statusText: ƒ statusText()
- get type: ƒ type()
- get url: ƒ url()
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,883 PostsLatest Activity: 10 hours agoIf 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 or Facebook.
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!