Hey guys,
I'm getting a pdf content and want to upload it in my dropbox with the API.
When i'm sending the request with the /upload method, i'm getting no response from dropbox ...
Can you please help on that ?
Here is my code :
HttpRequest req = new HttpRequest();
req.setEndpoint('https://content.dropboxapi.com/2/files/upload');
req.setHeader('Authorization','Bearer ' + token);
req.setHeader('Dropbox-API-Arg','{\"path\": \"/Liasses/Test.txt\",\"mode\": \"add\",\"autorename\":false}');
req.setHeader('Content-Type','application/octet-stream');
req.setMethod('POST');
req.setBody(EncodingUtil.base64Encode(blobToEncode));
req.setTimeout(60000);
Http h = new http();
HttpResponse res = new HttpResponse();
string resp = res.getBody();
system.debug('response : ' + resp);
Thanks in advance !