Domains are not being added, Whitelist domains facebook messenger extension

社会主义新天地 提交于 2019-12-08 18:57:26

The problem is I was using the App Access Token instead of the Page Access Token, I didn't know the difference.

your domain: "https://mydomainw..com" is an invalid domain.

The request should return:

{
  "error": {
    "message": "(#100) whitelisted_domains[0] should represent a valid URL",
    "type": "OAuthException",
    "code": 100,
    "fbtrace_id": "Aq3AVaNVJU9"
  }
}

Actually, I didn't use "setting_type" before. This is how I register domains:

var request = require("request");

var options = { method: 'POST',
  url: 'https://graph.facebook.com/v2.6/me/messenger_profile',
  qs: { access_token: 'my_page_token' },
  headers: { 'content-type': 'application/json' },
  body: 
   { whitelisted_domains: 
      [ 
        'https://mydomainw.com',
        'https://ijuugwivbc.localtunnel.me' ] },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!