【问题标题】:facebook webhook notification when someone like my page or liked or commented on my page post当有人喜欢我的页面或喜欢或评论我的页面帖子时,facebook webhook 通知
【发布时间】:2019-01-16 01:02:43
【问题描述】:

我有一个产品网站和该产品的 Facebook 页面。

1 . 是否可以通过 facebook webhook 以任何格式将页面喜欢或发布喜欢/评论数据到我的产品网站回调 url?

2.使用webhook是否需要创建facebook app?

【问题讨论】:

  • 当然,您首先需要一个应用程序。 (而且您还需要带有有效证书的 HTTPS。)您可以订阅的特定字段在文档中列出。
  • 我有 crate 和 app,我有 HTTPS 回调 url,我如何进一步获取回调 url 中的数据?
  • 您按照文档中的设置说明进行操作。
  • 如何获取我的页面的访问令牌?
  • 当我尝试创建订阅时,我收到错误“无法验证 URL。响应与质询不匹配,预期值 = '740804019', received=' .'" .

标签: facebook facebook-graph-api webhooks


【解决方案1】:
public override void ProcessRequest(HttpContext context)
    {
        try
        {
            for (int i = 0; i < context.Request.QueryString.Count; i++)
            {
                System.IO.File.AppendAllText(Server.MapPath("~") + "//Documents//Logs//APILog.txt", context.Request.QueryString[i]);
            } 
            if (context.Request.QueryString[2] == "My_new_token")
                context.Response.Write(context.Request.QueryString[1]);
        }
        catch (Exception ex)
        {
           System.IO.File.AppendAllText(Server.MapPath("~") + "//Documents//Logs//APILog.txt", "Exception:" + ex.Message);
        }
    }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-07-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-14
    • 1970-01-01
    • 2015-01-01
    • 1970-01-01
    相关资源
    最近更新 更多