Salesforce API Integration to Genesys Endpoint

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.

Hello,

I see you are trying to implement Client Credentials authorization. Here is the documentation on how to do it: https://developer.genesys.cloud/authorization/platform-auth/use-client-credentials. About the specific Genesys endpoint, please post your question in the Genesys Cloud Community Forum. This forum is centered around APIs and SDKs. Let me know if you have any further questions.

Regards

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.