You need to sign in to do that
Don't have an account?
Keith Stephens 18
Salesforce and send grid Unauthorized endpoint
Hello All,
I hope someone out here can help me, I am wanting to send emails out using sendgrid, I have created my sendgrid API Key, I have added the endpoint to SF remote settings "https://api.sendgrid.com/v3/mail/send".
And this works all fine in our sandbox, but now that it is in our production environment I seem to be getting an "16:46:10:021 EXCEPTION_THROWN [30]|System.CalloutException: Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = https://api.sendgrid.com/v3/mail/send".
I have verified my code in our sandbox and production environments are they are the same code.
Is there something else I might be missing?
Thanks for any help,
Keith.
I hope someone out here can help me, I am wanting to send emails out using sendgrid, I have created my sendgrid API Key, I have added the endpoint to SF remote settings "https://api.sendgrid.com/v3/mail/send".
And this works all fine in our sandbox, but now that it is in our production environment I seem to be getting an "16:46:10:021 EXCEPTION_THROWN [30]|System.CalloutException: Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = https://api.sendgrid.com/v3/mail/send".
I have verified my code in our sandbox and production environments are they are the same code.
Is there something else I might be missing?
Thanks for any help,
Keith.
Make sure that URL is setup as an active URL in the Remote Site Settings
Thanks,
Govindaraj.S
You haven't configured the remote site setttings to make an API call
Before any Visualforce page, Apex callout, or JavaScript code using XmlHttpRequest in an s-control or custom button can call an external site, that site must be registered in the Remote Site Settings page, or the call fails.
To access the page, from Setup, enter Remote Site Settings in the Quick Find box, then select Remote Site Settings. This page displays a list of any remote sites already registered and provides additional information about each site, including remote site name and URL.
To register a new site:
Thanks thou
Keith.
Refer this link
https://github.com/sendgrid/sendgrid-apex/blob/master/src/classes/SendGrid.cls
I could see in your code as, What is 'MY_SENDGRID_APIKEY' here ?
That should be something like below,
That resolved my issue.