I am doing Salesforce integration with SharePoint using OAuth 'client_credential' method. I am able to fetch file content and but unable to render that content as a word or pdf.or image file. Is there any URL which I can hit and it download file automatically in the browser.
HttpRequest reqWrite = new HttpRequest();
Http httpWrite = new Http();
endpoint = 'xxx.com/sites/dpmqa/_api/web/GetFileByServerRelativeUrl(\'/sites/xxx/Records/xxx/xxx.docx\')/$value';reqWrite.setEndpoint(endPoint);
reqWrite.setMethod('GET');
reqWrite.setHeader('Accept', 'application/json;odata=verbose');reqWrite.setHeader('Authorization','Bearer '+ accessToken);HttpResponse resWrite = new HttpResponse();
try{
resWrite = httpWrite.send(reqWrite);
try{ resWrite = httpWrite.send(reqWrite); – gangparia Aug 08 '17 at 11:03