0

I can see in sendgrid API we have a call to verify a single sender with a token

https://docs.sendgrid.com/api-reference/sender-verification/verify-sender-request

but I can't find a way to actually receive this token from anywhere, the only way is by sending an email that needs authentication (and we fall into this issue verifying sender email requires user to log in to sendgrid)

Anyone actually used this route in a way ?

Dany Y
  • 6,833
  • 6
  • 46
  • 83

1 Answers1

1

There is a workaround as follows: The link in the email redirects to a URL that looks like this https://app.sendgrid.com/settings/sender_auth/senders/verify?token=xyz, with the token query parameter. You can use that token in the api call to verify the sender email using your own api credentials.

  • ye you're right that would be a workaround, but it's a messy workaround to parse the whole email and get the token. I thought that since this endpoint exists, logically their should be an endpoint or webhook to get this token – Dany Y Dec 09 '22 at 16:10
  • @DanyY I don't think a webhook would proof that you "own" this email address. The only way would be to actually receive an email at the email address and get the verification token from the email. You can do this programmatically as well, but I do agree this is tedious. The URL redirecting to the actual verification URL is also tedious. I do have a C# sample of this, without programmatically retrieving the email. Let me know if you'd like to see it. – Swimburger Jan 10 '23 at 22:19
  • 1
    Thank you @Swimburger I implemented it like that parsing the email. Thanks for your help – Dany Y Jan 11 '23 at 16:18