0

I am using the following code to upload the files to Box.net from Salesforce using V2 api and got the following error

System.HttpResponse[Status=Not Found, StatusCode=404]

String sUrl = 'https://upload.box.com/api/2.0/files/data' ;
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint(sUrl);
req.setHeader('Authorization', newAuthorization);      
req.setMethod('POST');

req.setHeader('Content-Type', 'application/pdf');
String content = '{"filename":"/Users/rmasineni/temp/DealPackage/Cederquist Credit Memo.pdf", "folder_id":"0"}';

//String content = '{"filename":"&", "folder_id":"0"}';
req.setbody(content);

HttpResponse res;
res = h.send(req);

It will be great if someone helps me on how to use Box-api V2 to upload the files .

Thanks, Rag

  • Are you able to make this same request successfully using POSTMAN: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CFMQFjAA&url=https%3A%2F%2Fchrome.google.com%2Fwebstore%2Fdetail%2Ffdmmgilgnpjigdojojpjoooidkmcomcm&ei=sVj8T8T5MtDomAWzg-G_BQ&usg=AFQjCNE45hLAkbo_oq15xhKJrcsJDeRC7A – seanrose Jul 10 '12 at 16:31
  • I am facing with same problem. I have noticed salesforce dont allow post mult-part/form. Did you get a solution?? – Mario Luis Jul 22 '12 at 23:13

0 Answers0