Facebook Webhook测试按钮无法按预期工作 [英] Facebook Webhook Test Button not working as expected

查看:77
本文介绍了Facebook Webhook测试按钮无法按预期工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的webhooks设置中成功添加了回调URL.那时,已使用适当的日志和服务器中的所有内容成功调用了回调URL.但是,当我单击相应名称的TEST按钮(在这种情况下为Leadgen)时,服务器什么也没收到,实际上它至少应该记录第一行.请注意,我正在使用post and get.

I have successfully added my callback url in my webhooks setup. At that time, the callback url was called successfully with proper logs and everything in the server. But when I click on the TEST button for the respective name (leadgen in this case), nothing AT ALL is being received by the server when in fact it should at least log the very first line. Note that I am using post and get.

附加说明:对于NetSuite经验丰富的开发人员,我正在使用套件作为Webhook的回调URL.

Additional note: for NetSuite experienced developers, I am using a suitelet as the callback url for the webhook.

谢谢.

推荐答案

仅在请求中的User-Agent标头模仿浏览器的情况下,外部可用而无需登录的套件才可以使用.例如,请参见 SuiteAnswers#38695 .

Suitelets that are available externally without login will only work if the User-Agent header in the request mimics a browser. See for example SuiteAnswers # 38695.

我遇到了类似的问题,解决方法是使用 Google Cloud Function 代理请求a>只是重写了用户代理:

I ran into a similar issue, and the workaround was to proxy the request using a Google Cloud Function that simply rewrote the User Agent:

const request = require('request');

exports.webhook = (req, res) => {
  request.post(
      {
        url: process.env.NETSUITE_SUITELET_URL,
        body: req.body,
        json: true,
        headers: {
          'User-Agent': 'Mozilla/5',
          Authorization: req.headers['authorization'],
        },
      },
      function(error, response, body) {
        res.send(body);
      }
  );
};

这篇关于Facebook Webhook测试按钮无法按预期工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆