How to get SMTP-ID in sendgrid API through json? How to get SMTP-ID in sendgrid API through json? json json

How to get SMTP-ID in sendgrid API through json?


If you send an Email to SendGrid through the Web API, you won't have an SMTP-ID. That will be generated by the SendGrid server that translates the API call to an SMTP object. So you're right, the SMTP-ID that comes back in the Event POST isn't helpful.

However, you can add Unique Args to your API call using the x-smtpapi argument in the mail.send call. This will let you define whatever tracking metric(s) you want to the message, and it will all come back on the Event POST.


If you are going to use Unique Args feature, please do remember that they will appear in the most Event notifications but not all of them. Please refer for the details to the sendgrid forum topics which include "missing unique_args" and similar. So, think twice before "building the entire infrastructure" around this feature like some of us did :(


I got my answer .Actually we can try event API using a callback url, that receives POST request having every details about the email delivered, bounced in json format. Whenever some event is triggered we get a request from Sendgrid. Thats cool.

We can keep these details for further Filtering.

Anyway , thanks jacobmovingfwd