function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
EQ AdminEQ Admin 

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.

​​​​​​​