【问题标题】:sendgrid_webapi event notification sendgridsendgrid_webapi 事件通知 sendgrid
【发布时间】:2013-12-02 23:23:14
【问题描述】:

我在检索我的 SendGrid 帐户的事件通知时遇到了困难,我不确定如何继续。

我正在使用 sendgrid_webapi gem (https://github.com/kylejginavan/sendgrid_webapi),并尝试使用 README.rdoc 提供的准系统实现来检索客户端的事件通知。

很简单:

client = SendGridWebApi::Client.new(*user*, *password*)
notifications = client.event_notification.get()
return notifications

其他每个调用(退回、取消订阅等)都按预期工作,但由于某种原因,除了我在 SendGrid 界面中指定的 URL(我已启用所有事件和事件通知应用程序)。

gem 的文档指出,可以在 http://sendgrid.com/docs/API_Reference/Webhooks/event.html 找到可用的选项,但我无法获取该信息并将其转化为可以在拨打电话时使用的有形的东西。

我觉得这只是我缺少的一些简单的东西,但任何帮助/指导将不胜感激。

提前致谢!

【问题讨论】:

  • webhook 设置为您向 SendGrid 提供一个 URL,SendGrid 将在事件发生时实时对该 URL 执行 HTTP POST。此外,您需要使用 Silver 包或更高版本才能启用 webhook

标签: ruby-on-rails sendgrid


【解决方案1】:

您尝试使用的 API 调用是用于配置 Event Webhook,而不是用于消费事件。

Webhook 是一种“推送”API,而不是用于查询信息的 API。为了使用 webhook,您需要使用可以处理来自 SendGrid 的 HTTP 帖子的脚本来设置 URL。

这是一个名为 gridhook 的 gem,可以满足您的需求。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-18
    • 2016-09-20
    相关资源
    最近更新 更多