Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 我可以从我的facebook个人资料在网站上自动发布facebook帖子吗?_Php_Facebook_Facebook Graph Api - Fatal编程技术网

Php 我可以从我的facebook个人资料在网站上自动发布facebook帖子吗?

Php 我可以从我的facebook个人资料在网站上自动发布facebook帖子吗?,php,facebook,facebook-graph-api,Php,Facebook,Facebook Graph Api,我试图在我的网站页面上显示我的facbook个人资料的所有帖子。我能买这个吗。有没有可能从facebook的网站上获得这篇文章 如果可能的话,请告诉我解决办法 我读的不是这个问题 我正在使用此$token=https://graph.facebook.com/oauth/access_token?client_id=“.APP_ID.&client_secret=”.APP_secret.&grant_type=client_凭证”; 获取accesstoken,但显示错误消息{ “错误”:{

我试图在我的网站页面上显示我的facbook个人资料的所有帖子。我能买这个吗。有没有可能从facebook的网站上获得这篇文章

如果可能的话,请告诉我解决办法

我读的不是这个问题

我正在使用此
$token=https://graph.facebook.com/oauth/access_token?client_id=“.APP_ID.&client_secret=”.APP_secret.&grant_type=client_凭证”;

获取accesstoken,但显示错误消息
{
“错误”:{
“消息”:“验证应用程序时出错。应用程序ID无效。”,
“类型”:“OAutheException”,
“代码”:101
}
}

我正在使用正确的应用程序ID和应用程序机密。。但无法获取accesstoken


有谁能告诉我如何获取上述问题所需的访问令牌。

您需要长寿命访问令牌

有一种方法可以将此延长到60天。此处描述:

为了扩展访问令牌,您需要使用短期访问令牌发出以下请求:

https://graph.facebook.com/oauth/access_token?             
    client_id=APP_ID&
    client_secret=APP_SECRET&
    grant_type=fb_exchange_token&
    fb_exchange_token=EXISTING_ACCESS_TOKEN 
以及如何使用此脚本在墙上张贴

$page_access_token = 'your access token';
$page_id = 'page id';
$data['message'] = "";
$data['access_token'] = <Your access token>;
$post_url = 'https://graph.facebook.com/'.$page_id.'/feed';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $post_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$return = curl_exec($ch);
curl_close($ch);
$page_access_token='your access token';
$page_id='page id';
$data['message']=“”;
$data['access_token']=;
$post\u url='1https://graph.facebook.com/“.$page_id./feed”;
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,$post_URL);
卷曲设置($ch,卷曲设置桩,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$return=curl\u exec($ch);
卷曲关闭($ch);