Node.js 未添加域,白名单域facebook messenger扩展
我一直试图按照facebook的指示将我的域名列入白名单,但没有任何效果 我第一次尝试使用curl,结果是Node.js 未添加域,白名单域facebook messenger扩展,node.js,facebook-messenger,whitelist,facebook-messenger-bot,botkit,Node.js,Facebook Messenger,Whitelist,Facebook Messenger Bot,Botkit,我一直试图按照facebook的指示将我的域名列入白名单,但没有任何效果 我第一次尝试使用curl,结果是{result:“success”},但是当我尝试列出被列入白名单的域时,我得到的是{data:[]} 然后,我尝试使用节点请求模块,如下所示: request.post("https://graph.facebook.com/v2.6/me/messenger_profile?access_token=sfdlksdfu79r9429049824982342348sjdfsf", {
{result:“success”}
,但是当我尝试列出被列入白名单的域时,我得到的是{data:[]}
然后,我尝试使用节点请求模块,如下所示:
request.post("https://graph.facebook.com/v2.6/me/messenger_profile?access_token=sfdlksdfu79r9429049824982342348sjdfsf", {
"setting_type": "domain_whitelisting",
"whitelisted_domains": ["https://mydomainw.com", "https://mydomainw.com/profile", "https://sfujyx.com/ofr", "mydomain1.com", "mydomain.com"],
"domain_action_type": "add"}, function (err, res, body) {
console.log("Whitelisting domain");
if (!err) {
console.log(body);
console.log("Showing the list of whitelisted:");
request.get("https://graph.facebook.com/v2.6/me/messenger_profile?fields=whitelisted_domains&access_token=sfdlksdfu79r9429049824982342348sjdfsf", function (err, res, body) {
if (!err) {
console.log(body);
} else {
console.log(err);
}
});
} else {
console.log(err);
}
});
但它仍然带来与curl相同的结果:
当我使用Facebook Graph Api Explorer工具时,我得到的错误如下:
我真的被卡住了,我不知道我该怎么做,也不知道人们如何准确地将messenger扩展的域列入白名单
我做错了什么?为什么没有添加域
我的项目在Google App Engine上。您的域:“”是无效域
请求应返回:
{
"error": {
"message": "(#100) whitelisted_domains[0] should represent a valid URL",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "Aq3AVaNVJU9"
}
}
您的域:“”是无效的域
请求应返回:
{
"error": {
"message": "(#100) whitelisted_domains[0] should represent a valid URL",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "Aq3AVaNVJU9"
}
}
实际上,我以前没有用过“设置类型”。这是我注册域的方式:
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);
});
实际上,我以前没有用过“设置类型”。这是我注册域的方式:
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);
});
问题是我使用的是应用程序访问令牌而不是页面访问令牌,我不知道区别。问题是我使用的是应用程序访问令牌而不是页面访问令牌,我不知道区别。嘿@Micheal Vu,不正确,我的意思是,但无论如何,所有这些领域都不是我的,它们是用来说明我在做什么的。我不想透露我想要列入白名单的真实域名。我还添加了更多的信息,因为自从上次以来我一直在尝试不同的方法(GraphAPI工具),但什么都不起作用。你需要我的真实域名来尝试吗?嘿@Micheal Vu,这是不对的,我的意思是,但无论如何,所有这些域名都不是我的,它们是用来说明我在做什么的。我不想透露我想要列入白名单的真实域名。我还添加了更多的信息,因为自从上次以来我一直在尝试不同的方法(GraphAPI工具),但什么都不起作用。您需要我的真实域来尝试吗?我认为您使用了错误的api路径。它应该是“/me/messenger_profile”。{“error”:{“message”:“不支持的post请求。ID为“me”的对象不存在,由于缺少权限而无法加载,或者不支持此操作。请阅读位于“,”type“:”GraphMethodException“,”code“:100,“fbtrace_ID:”BDenwqcm3BD”的图形API文档}}是当我把/me/messenger_profile@MichealVuyou放在上面的消息时得到的响应,因为您使用了错误的访问令牌。您应该尝试获取页面访问令牌。我认为您使用了错误的api路径。它应该是“/me/messenger_profile”。{“error”:{“message”:“不支持的post请求。ID为“me”的对象不存在,由于缺少权限而无法加载,或者不支持此操作。请阅读位于“,”type“:”GraphMethodException“,”code“:100,“fbtrace_ID:”BDenwqcm3BD”的图形API文档}}是当我把/me/messenger_profile@MichealVuyou放在上面的消息时得到的响应,因为您使用了错误的访问令牌。您应该尝试获取页面访问令牌。我也在做同样的事情,但我有一个字符串数组,其中包含要列入白名单的所有域,并且希望将一个数组分配给列入白名单的\u域,而不仅仅是为其提供字符串,我该怎么做呢?我也在做同样的事情,但是我有一个字符串数组,其中包含所有要被列入白名单的域,并且希望将一个数组分配给列入白名单的\u域,而不仅仅是给它输入字符串,我该怎么做?