Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
Vivek K.2
9 years agoNew member | Level 1
Unable to Upload the File into DropBox From Salesforce Using /Files_put API ?
Hi All,
I tried to upload the file into Drop Box account From Salesforce Using /files_put Dropbox Api.But am always getting following Error : [Status=Bad Request, StatusCode=400]{"error": "B...
Vivek K.2
9 years agoNew member | Level 1
Hi Gregory,
I updated my code like below,even though am getting Error : [Status=Bad Request, StatusCode=400]{"error": "Body may not be empty"}.
public class DropboxController
{
public Blob FileBody{get;set;}
public DropboxController()
{
}
public PageReference DropAuth()
{
HttpRequest request = new HttpRequest();
request.setMethod('POST');
request.setTimeout(60000);
request.setEndpoint('https://api-content.dropbox.com/1/files_put/auto/Test.txt');
Blob val = csvFileBody;
Blob accesstoken = Blob.valueOf('<redacted>');
String AccToken = 'Bearer ' + EncodingUtil.base64Encode(accesstoken);
request.setHeader('Authorization', AccToken);
request.setBodyAsBlob(val);
System.debug(val);
Http hp = new Http();
HttpResponse response = hp.send(request);
System.debug(' RESP ::: ' +response +''+ response.getBody());
return null;
}
}
Can i have your suggestion .
Thanks,
Vivek K
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
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!