Adding Remote Site Settings
Before any Apex callout can call an external site, that site must be registered in the Remote Site Settings page, or the callout fails. Salesforce prevents calls to unauthorized network addresses.
If the callout specifies a named credential as the endpoint, you don’t need to configure remote site settings. A named credential specifies the URL of a callout endpoint and its required authentication parameters in one definition. To set up named credentials, see “Define a Named Credential” in the Salesforce Help.
To add a remote site setting:
- From Setup, enter
Remote Site Settings in the Quick Find box, then select Remote Site Settings.
- Click New Remote Site.
- Enter a descriptive term for the
Remote Site Name.
- Enter the URL for the remote site.
- Optionally, enter a description of the site.
- Click Save.
For best performance, verify that your remote HTTPS encrypted sites have OCSP (Online Certificate Status Protocol) stapling turned on.