An Apex callout enables you to tightly integrate your Apex with an external service by making a call to an external Web service or sending an HTTP request from Apex code and then receiving the response and When we want to make a callout from Salesforce then we need to add the address of the site to salesforce to allow the external callout. This address is added to the Remote Site settings.
Salesforce allows you to access external website resources from a Salesforce application for your organization. You can access these external websites through Visualforce pages, Apex Callout, and via XmlHttpRequest calls. To avoid accessing malicious websites from Salesforce.com, the website first needs to be registered with site settings. Once the site is registered, it can be used within Salesforce.com.
Steps to add an external site to salesforce to callout:
- Go to Setup.
- Search for Remote Site settings (or you can navigate to Administer → Security Controls → Remote Site Settings.)
Click on the new remote site.
- Add the Name.
- Add the website URL that you want to give access to.
- Click Save.