Попытка получить токен снизу сервиса. Получение ошибочного запроса в логах.
publi c class PegaCallbackService {
@future (callout=true)
public static void RequestAuthorizationToken(string json){
try{
HttpRequest request = new HttpRequest();
HttpResponse response = new HttpResponse();
Http http = new Http();
request.setEndpoint('https://equini-eqbill-dt1.pegacloud.net/prweb/PRRestService/oauth2/v1/token');
request.setHeader('Content-Type','application/json');
request.setMethod('POST');
request.setHeader('client_id','10863622547421372260');
request.setHeader('client_secret','DEB45EBE65B13D86D13E28F002C01D35');
request.setHeader('grant_type','client_credentials');
request.setBody(json);
request.setCompressed(true);
response = http.send(request);
system.debug('--response'+response);
if (response.getStatusCode() == 200) {
System.debug('Response-' + response);
}
}
catch(System.CalloutException e){
System.debug('Error-' + e.getMessage());
}
}