System.CalloutException: Unauthorized endpoint, please check Setup->Security->Remote site settings - Salesforce Globe For You
Problem: This error generally occurs when the callout is made to any external system endpoint
without adding the base URL of endpoint in the remote site settings of Salesforce
Solution: Go to Setup --> Security --> Remote Site Settings
click the 'New Remote Site' button and add the endpoint url in Remote Site Url.
Give any name ,keep active checkbox as true and save the record.
That's it. Now execute the same code again and it works.
No comments:
Post a Comment