Hi all,
I am trying to Fax docuemnt from Sales Force through Genesys CTI. But I am getting error (Endpoint is incorrect) , here is my Apex class :
String clientId = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
String clientSecret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
HttpRequest req = new HttpRequest();
req.setMethod('POST');
req.setHeader('Authorization', 'Basic ' +
EncodingUtil.base64Encode(Blob.valueOf(clientId + ':' + clientSecret)));
req.setHeader('Host','https://apps.usw2.pure.cloud/oauth');
req.setHeader('content-type', 'application/x-www-form-urlencoded');
req.setEndpoint('https://apps.usw2.pure.cloud/oauth/token');
req.setBody('grant_type=client_credentials');
Http http = new Http();
try{
HTTPResponse res = http.send(req);
System.debug('value of Status code: ' + res.getStatusCode());
System.debug('value of res: ' + res.getBody());
} catch(System.CalloutException e){
// do something useful here
}
Any thoughts , will be appreciated.
Thanks
#Integrations------------------------------
Bassel Nafaa
Prospero Management Services, LLC.
------------------------------