将标签添加到粉丝页面不起作用...错误:(#210)主题必须是页面 [英] Adding a tab to a fan page does not work... error: (#210) Subject must be a page
问题描述
我尝试使用graph api / PHP SDK将粉丝添加到粉丝专页,并收到一条错误:
(#210 )主题必须是页面
我试过使用用户 access_token
和页面 access_token
,但都不工作。我试过使用许多帐户的页面ID,仍然没有去。这是我的代码:
<?php
$ path =/ PAGE_ID / tabs / ;
$ access_token =ACCESS_TOKEN;
$ params = array(
'app_id'=>APP_ID,
'access_token'=> $ access_token
);
try {
$ install = $ facebook-> api($ path,POST,$ params);
} catch(FacebookApiException $ o){
print_r($ o);
}
?>
这里是我得到的错误:
FacebookApiException物件
(
[result:protected] => Array
(
[error] =& b(
[message] =>(#210)主题必须是页面
[type] => OAuthException
)
)$ b b
[message:protected] =>(#210)主题必须是页面
[string:Exception:private] =>
[code:protected] => 0感谢您提供任何帮助! h2_lin>解决方案
但这里是一个JS的解决方案:OAuthException(#210)主题必须是网页。 - 只是不要使用库并自己调用。
我使用PHP:
<?php
$ url ='https://graph.facebook.com/<Page ID> / tabs?app_id =< APP ID>& method = POST& access_token =< ; PAGE ACCESS TOKEN>& callback = test';
$ ch = curl_init();
curl_setopt($ ch,CURLOPT_URL,$ url);
$ result = curl_exec($ ch);
curl_close($ ch);
echo $ result;
?>
回声值应该是test(true)。
I'm trying to add a tab to a fanpage using the graph api/PHP SDK and I'm receiving an error :
(#210) Subject must be a page
I've tried using both the user access_token
AND the page access_token
but neither work. I've tried using the page id of numerous accounts and still no go. Here is my code:
<?php
$path="/PAGE_ID/tabs/";
$access_token="ACCESS_TOKEN";
$params = array(
'app_id' => "APP_ID",
'access_token' => $access_token
);
try{
$install = $facebook->api($path, "POST", $params);
}catch (FacebookApiException $o){
print_r($o);
}
?>
And here is the error I get:
FacebookApiException Object
(
[result:protected] => Array
(
[error] => Array
(
[message] => (#210) Subject must be a page.
[type] => OAuthException
)
)
[message:protected] => (#210) Subject must be a page.
[string:Exception:private] =>
[code:protected] => 0
Thanks for any help you can provide!
解决方案 API Call is atm bugged: https://developers.connect.facebook.com/bugs/149252845187252?browse=search_4f31da351c4870e34879109
But here is a solution for JS: OAuthException "(#210) Subject must be a page." - just do not use the library and do your own call.
I did it with PHP:
<?php
$url = 'https://graph.facebook.com/<PAGE ID>/tabs?app_id=<APP ID>&method=POST&access_token=<PAGE ACCESS TOKEN>&callback=test';
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
?>
Echo value should be something like "test(true)".
这篇关于将标签添加到粉丝页面不起作用...错误:(#210)主题必须是页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!