You need to sign in to do that
Don't have an account?

Need help in creating HTTP callout
I have to call a webservice hosted on Pega with below end point adress.
Need help in generati ng token and authentication part.
// Calling webservice
PegaCallbackService.SendValidationStatus(Json.Serialize(pegaResponse));
public class PegaCallbackService {
@future (callout=true)
public static void SendValidationStatus(String json) {
try{
HttpRequest request = new HttpRequest();
HttpResponse response = new HttpResponse();
Http http = new Http();
request.setEndpoint('');
request.setHeader('Content-Type','application/json');
request.setMethod('POST');
request.setBody(json);
request.setCompressed(true);
response = http.send(request);
if (response.getStatusCode() == 200) {
System.debug('Response-' + response);
}
}
catch(System.CalloutException e){
System.debug('Error-' + e.getMessage());
}
}
}
I have created a basic structure but not sure how to do authentication part. How will it work.
Need help in generati ng token and authentication part.
// Calling webservice
PegaCallbackService.SendValidationStatus(Json.Serialize(pegaResponse));
public class PegaCallbackService {
@future (callout=true)
public static void SendValidationStatus(String json) {
try{
HttpRequest request = new HttpRequest();
HttpResponse response = new HttpResponse();
Http http = new Http();
request.setEndpoint('');
request.setHeader('Content-Type','application/json');
request.setMethod('POST');
request.setBody(json);
request.setCompressed(true);
response = http.send(request);
if (response.getStatusCode() == 200) {
System.debug('Response-' + response);
}
}
catch(System.CalloutException e){
System.debug('Error-' + e.getMessage());
}
}
}
I have created a basic structure but not sure how to do authentication part. How will it work.