Facebook graph api 如何解决;参数“U字段为必填项”;向应用程序订阅facebook页面时出错?
我正在创建一个应用程序,它将从我管理的facebook页面中提取线索,并随后将其更新到谷歌表单中 我已经设置了webhook,生成了具有以下权限的长寿命页面访问令牌Facebook graph api 如何解决;参数“U字段为必填项”;向应用程序订阅facebook页面时出错?,facebook-graph-api,Facebook Graph Api,我正在创建一个应用程序,它将从我管理的facebook页面中提取线索,并随后将其更新到谷歌表单中 我已经设置了webhook,生成了具有以下权限的长寿命页面访问令牌 管理页面 页面显示列表 线索检索 广告管理 你读的广告 当我尝试使用POST请求{page\u id}/subscribed\u apps将页面订阅到我的应用时,我得到以下错误 { "error": { "message": "(#100) The parameter subscribed_fields is req
- 管理页面
- 页面显示列表
- 线索检索
- 广告管理
- 你读的广告
{page\u id}/subscribed\u apps
将页面订阅到我的应用时,我得到以下错误
{
"error": {
"message": "(#100) The parameter subscribed_fields is required.",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "Fv7RbO8tYqo"
}
}
调查显示,facebook在v3.2API中添加了一个名为subscribed_fields的新参数,但我不确定值必须如何传递给该参数,或者我缺少什么 当我尝试为facebook\u主打广告活动添加webhook时,我也遇到了同样的问题。。。它过去在以前的版本上工作得很好,我已经通过了以下范围: “管理页面”
函数myFacebookLogin(){
FB.登录(功能(响应){
console.log('成功登录',响应);
FB.api(“/me/accounts”,
{限制:200},
功能(响应){
log('成功检索页面',响应);
var pages=response.data;
var ul=document.getElementById('list');
对于(变量i=0,len=pages.length;i
}
也许,这可以帮助你们: 以POST请求的形式如下: 因此,您需要创建此项。:) 我对权限有一些问题,奇怪的是,我在这里反复检查了我的页面权限: 似乎我有fb错误响应信息中遗漏的权限 我得到的回答是:
{
"error": {
"message": "(#200) To subscribe to the feed field, one of these permissions is needed: manage_pages. To subscribe to the mention field, one of these permissions is needed: manage_pages. To subscribe to the name field, one of these permissions is needed: manage_pages. To subscribe to the picture field, one of these permissions is needed: manage_pages. To subscribe to the category field, one of these permissions is needed: manage_pages. To subscribe to the description field, one of these permissions is needed: manage_pages. To subscribe to the conversations field, one of these permissions is needed: manage_pages. To subscribe to the branded_camera field, one of these permissions is needed: manage_pages. To subscribe to the feature_access_list field, one of these permissions is needed: manage_pages. To subscribe to the standby field, one of these permissions is needed: manage_pages. To subscribe to the messages field, one of these permissions is needed: manage_pages. To subscribe to the messaging_account_linking field, one of these permissions is needed: manage_pages. To subscribe to the messaging_checkout_updates field, one of these permissions is needed: manage_pages. To subscribe to the message_echoes field, one of these permissions is needed: manage_pages. To subscribe to the message_deliveries field, one of these permissions is needed: manage_pages. To subscribe to the messaging_game_plays field, one of these permissions is needed: manage_pages. To subscribe to the messaging_optins field, one of these permissions is needed: manage_pages. To subscribe to the messaging_optouts field, one of these permissions is needed: manage_pages. To subscribe to the messaging_payments field, one of these permissions is needed: manage_pages. To subscribe to the messaging_postbacks field, one of these permissions is needed: manage_pages. To subscribe to the messaging_pre_checkouts field, one of these permissions is needed: manage_pages. To subscribe to the message_reads field, one of these permissions is needed: manage_pages. To subscribe to the messaging_referrals field, one of these permissions is needed: manage_pages. To subscribe to the messaging_handovers field, one of these permissions is needed: manage_pages. To subscribe to the messaging_policy_enforcement field, one of these permissions is needed: manage_pages. To subscribe to the messaging_page_feedback field, one of these permissions is needed: manage_pages. To subscribe to the messaging_appointments field, one of these permissions is needed: manage_pages. To subscribe to the founded field, one of these permissions is needed: manage_pages. To subscribe to the company_overview field, one of these permissions is needed: manage_pages. To subscribe to the mission field, one of these permissions is needed: manage_pages. To subscribe to the products field, one of these permissions is needed: manage_pages. To subscribe to the general_info field, one of these permissions is needed: manage_pages. To subscribe to the leadgen field, one of these permissions is needed: leads_retrieval. To subscribe to the leadgen_fat field, one of these permissions is needed: leads_retrieval. To subscribe to the location field, one of these permissions is needed: manage_pages. To subscribe to the hours field, one of these permissions is needed: manage_pages. To subscribe to the parking field, one of these permissions is needed: manage_pages. To subscribe to the public_transit field, one of these permissions is needed: manage_pages. To subscribe to the page_about_story field, one of these permissions is needed: manage_pages. To subscribe to the phone field, one of these permissions is needed: manage_pages. To subscribe to the email field, one of these permissions is needed: manage_pages. To subscribe to the website field, one of these permissions is needed: manage_pages. To subscribe to the ratings field, one of these permissions is needed: manage_pages. To subscribe to the attire field, one of these permissions is needed: manage_pages. To subscribe to the payment_options field, one of these permissions is needed: manage_pages. To subscribe to the culinary_team field, one of these permissions is needed: manage_pages. To subscribe to the general_manager field, one of these permissions is needed: manage_pages. To subscribe to the price_range field, one of these permissions is needed: manage_pages. To subscribe to the awards field, one of these permissions is needed: manage_pages. To subscribe to the hometown field, one of these permissions is needed: manage_pages. To subscribe to the current_location field, one of these permissions is needed: manage_pages. To subscribe to the bio field, one of these permissions is needed: manage_pages. To subscribe to the affiliation field, one of these permissions is needed: manage_pages. To subscribe to the birthday field, one of these permissions is needed: manage_pages. To subscribe to the personal_info field, one of these permissions is needed: manage_pages. To subscribe to the personal_interests field, one of these permissions is needed: manage_pages. To subscribe to the publisher_subscriptions field, one of these permissions is needed: manage_pages. To subscribe to the members field, one of these permissions is needed: manage_pages. To subscribe to the checkins field, one of these permissions is needed: manage_pages. To subscribe to the page_upcoming_change field, one of these permissions is needed: manage_pages. To subscribe to the page_change_proposal field, one of these permissions is needed: manage_pages. To subscribe to the merchant_review field, one of these permissions is needed: manage_pages. To subscribe to the product_review field, one of these permissions is needed: manage_pages. To subscribe to the videos field, one of these permissions is needed: manage_pages. To subscribe to the live_videos field, one of these permissions is needed: manage_pages. To subscribe to the registration field, one of these permissions is needed: manage_pages",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "HTI8+tPvJZt"
}
}
但我希望你能避免这个错误 从facebook api v3.2开始,我也遇到了问题 以下是@AdityaChowdhary的原始版本的修订内容:-添加“subscribed_fields:'leadgen'”作为post参数,如下所示:
FB.api(
'/' + page_id + '/subscribed_apps',
'post',
{ access_token: page_access_token, subscribed_fields: 'leadgen' },
function (response) {
console.log('Successfully subscribed page', response);
});
FB.login(function (response) {
...
}, {scope: ['manage_pages', 'leads_retrieval']});
然后,您可能会遇到另一个错误:“要订阅leadgen字段,需要以下权限之一:leads\u retrieval”
为防止权限错误:将“leads\u retrieval”权限添加到fb.login范围,如下所示:
FB.api(
'/' + page_id + '/subscribed_apps',
'post',
{ access_token: page_access_token, subscribed_fields: 'leadgen' },
function (response) {
console.log('Successfully subscribed page', response);
});
FB.login(function (response) {
...
}, {scope: ['manage_pages', 'leads_retrieval']});
在新的Graph API v3.2中,必须传递参数
subscribed_fields
,以及post
请求me/subscribed_apps
(页面访问令牌作为访问令牌)。您需要传递一组可用的可下标字段,这些字段是:
[
feed, mention, name, picture, category, description, conversations,
branded_camera, feature_access_list, standby,
messages, messaging_account_linking, messaging_checkout_updates,
message_echoes, message_deliveries, messaging_game_plays, messaging_optins,
messaging_optouts, messaging_payments, messaging_postbacks,
messaging_pre_checkouts, message_reads, messaging_referrals,
messaging_handovers, messaging_policy_enforcement,
messaging_page_feedback, messaging_appointments, founded,
company_overview, mission, products, general_info, leadgen,
leadgen_fat, location, hours, parking, public_transit,
page_about_story, phone, email, website, ratings, attire,
payment_options, culinary_team, general_manager, price_range,
awards, hometown, current_location, bio, affiliation, birthday,
personal_info, personal_interests, publisher_subscriptions, members,
checkins, page_upcoming_change, page_change_proposal,
merchant_review, product_review, videos, live_videos, registration,
]
例如:
subscribed\u字段:[“消息”,“消息传递”]
在请求中添加subscribed\u字段=publisher\u订阅对我有效。代码如下:
request({
method: 'POST',
uri: `https://graph.facebook.com/v2.6/me/subscribed_apps?subscribed_fields=publisher_subscriptions&access_token=${FB_PAGE_ACCESS_TOKEN}`
},
(error, response, body) => {
if (error) {
console.error('Error while subscription: ', error);
} else {
console.log('Subscription result: ', response.body);
}
});
对于fb.login,您不能使用“管理页面”作为作用域,请尝试使用以下内容:
{scope: ['pages_show_list','leads_retrieval']}
谢谢你的帮助!我能够成功地将页面切换到应用程序,但现在我在启动测试线索时收到错误102,并显示错误消息“服务器失败”。错误截图-Hi@solar_Consident