简体   繁体   English

如何使用Java中的sendgrid API获取已处理,已交付,退回,删除等事件?

[英]How to get the events like Processed, Delivered, Bounced, Dropped using sendgrid API in Java?

We are using sendgrid API to send emails via our web portal developed using Java. 我们正在使用sendgrid API通过使用Java开发的Web门户发送电子邮件。 We would like to capture the real time events using our portal for every mail sent using Event Webhook. 我们想使用门户网站捕获使用事件Webhook发送的每封邮件的实时事件。 Please tell us the implementation process. 请告诉我们实施过程。

We have tried using a block of code but it didn't work. 我们尝试使用代码块,但是没有用。

request.method = Method.PATCH;    
request.endpoint = "user/webhooks/event/settings";    
request.body = "{\"group_resubscribe\":true,\"delivered\":true,\"group_unsubscribe\":true,\"spam_report\":true,\"url\":\"url\",\"enabled\":true,\"bounce\":true,\"deferred\":true,\"unsubscribe\":true,\"dropped\":true,\"open\":true,\"click\":true,\"processed\":true}";    
response = sendgrid.api(request);    
String events = response.body;    
Gson gson = new Gson();    
Object obj = gson.toJson(events);    

Event Notification needs to be configured in https://app.sendgrid.com/settings/mail_settings 需要在https://app.sendgrid.com/settings/mail_settings中配置事件通知

Based on the configuration, Sendgrid sends JSON messages in real time to the URL which is provided. 根据配置,Sendgrid将JSON消息实时发送到所提供的URL。

enter image description here 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在java中获得退回的邮件 - How to get Bounced mails in java 如何使用Java在sendgrid中获取有关特定电子邮件的事件? - How can I get events about a specific email in sendgrid using java? 使用Java邮件api通过gmail发送的邮件会传递到垃圾邮件。 如何使它们传递到收件箱? - Mails sent through gmail using java mail api are delivered to spam. How to make them delivered to the inbox? 使用Java的Android SendGrid API - SendGrid API for Android using Java 如何使用sendgrid邮件api发送附件 - how to send attachment using sendgrid mail api 如何通过反射 API 在 Java 中获取已处理的对象并为其设置新值? - How to get processed object and set it a new value to it in Java via Reflection API? Java Gate API。 成功创建管道,如何从处理的文档中获取注释集? - java gate api. Creating pipeline with success, how can i get the annotationsets from the docs processed? Java-Java中的SendGrid解析API - Java - SendGrid Parse API in Java 使用Java API从Outlook.com获取日历事件 - Get calendar events from Outlook.com using Java API 如何使用java api使用“like”查询mongodb? - How to query mongodb with “like” using the java api?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM