Hi,
If anyone can help me with this.
I use PureCloud API /api/v2/conversations/emails/{conversationId}/messages, to get email contentURI:
"attachments": [
{
"attachmentId": "c9b3c6f2-ddb2-4c90-a3.....",
"name": "xx.log",
"contentUri": "https://api.mypurecloud.com.au/api/v2/downloads/0d......",
"contentType": "application/octet-stream",
"contentLength": 189561,
"inlineImage": false
}
And I do httprequest in Salesforce to download this as a stream, as following:
HTTP h = new HTTP();
String authorizationHeader = 'Bearer xxxxxxxxx';
HttpRequest req = new HttpRequest();
req.setEndpoint('https://api.mypurecloud.com.au/api/v2/downloads/0d0f.........');
req.setMethod('GET');
req.setHeader('Content-Type', 'application/octet-stream');
req.setHeader('authorization',authorizationHeader);
HttpResponse res = h.send(req);
String body = res.getBody();
system.debug('response: '+res.getStatus());
if(body=='') return 'empty';
else return body;
And it always endedup with result Response 303 - See other, although I have put bearer token properly (PureCloud - oauth grant implicit).
Thank you for help in advance.
Fransiska