String clientId = '892f9d47-da1c-401f-beac-2e32bd47b470';
String clientSecret = 'i_QjntQk-HvdMZWKIYHZBepq7vQ5zziAjAD4jaRESw4';
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
}
This is the above code, I am trying to Hit the Genesys Endpoint URL but its giving me an 401, 402 Unauthorized access to Endpoint URL.
Can someone help me how to find the Genesys ENDPOINT URL and Client ID and Client Secret.
I tried by using the POSTMAN as well to just try to hit the Endpoint but still same error.
Please suggest me how to find the correct Endpoint URL for Genesys Cloud.