Below is what mentioned on sendgrid. [but when i give end poit shown code cant see anything happening]
"SendGrid's Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email" This is what mentioned on site.
below is my api
[HttpPost][Route("webhook")]publicvoidEmailEvents([FromBody]SendGridEventObject[] eventList){try{
using (StreamWriter file =System.IO.File.CreateText(@"D:\EmailResponseStatus.txt")){JsonSerializer serializer =newJsonSerializer();if(eventList !=null&& eventList.Count()>0){foreach(var evnt in eventList){
serializer.Serialize(file, evnt);}}else{
serializer.Serialize(file,"empty");}}}catch(Exception){throw;}}
I have given this url on sendgrid and try to run integration test it says A sample event notification will be sent to your endpoint shortly, but i dont see anything happening,when i have set debug point as well.
i can see the response, can any one tell me what i am doing wrong here in my Api endpoint ? i want this response to be read and send it to other service.
Really Appreciate your help,Thanks in advance.
</div> </div>
Amitha
All the Best . Please 'Mark this Post as Answer ' if it helps you.
I can see that there is no error in your api codes. If you have already set the call back URL in the
SendGrid UI, you could check below verifications.
If you still could not receive the response, I suggest you narrow the problem scope following below steps:
Check whether your api is accessible or not. For example, you could use postman to post a simulation data to this webhook api.
Check if you have set the OAUTH in your project, you might need to configure the corresponding setting in
SendGrid UI
Another possible reason is that you have not called SendGrid service currently so that the event response would not be sent to you until the next service is called.
Hope this can help you.
Best regards,
Sean
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
59 Points
197 Posts
Sendgrid Event Webhook
Jul 03, 2020 01:57 PM|amithashenoy|LINK
How to read Event hook response from sendgrid ?
Below is what mentioned on sendgrid. [but when i give end poit shown code cant see anything happening]
"SendGrid's Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email" This is what mentioned on site.
below is my api
I have given this url on sendgrid and try to run integration test it says A sample event notification will be sent to your endpoint shortly, but i dont see anything happening,when i have set debug point as well.
When i use the url as they have mentioned in below link https://sendgrid.com/docs/for-developers/tracking-events/getting-started-event-webhook/
i can see the response, can any one tell me what i am doing wrong here in my Api endpoint ? i want this response to be read and send it to other service.
Really Appreciate your help,Thanks in advance.
</div> </div>
All the Best . Please 'Mark this Post as Answer ' if it helps you.
Contributor
2870 Points
843 Posts
Re: Sendgrid Event Webhook
Jul 06, 2020 09:49 AM|Sean Fang|LINK
Hi amithashenoy,
I can see that there is no error in your api codes. If you have already set the call back URL in the SendGrid UI, you could check below verifications.
If you still could not receive the response, I suggest you narrow the problem scope following below steps:
Hope this can help you.
Best regards,
Sean