Facebook Graph Api - 以管理员身份发布到粉丝页面 [英] Facebook Graph Api - Posting to Fan Page as an Admin

查看:31
本文介绍了Facebook Graph Api - 以管理员身份发布到粉丝页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置了一个脚本,允许用户在 Facebook 的粉丝页面上发布消息.一切正常,但有一个小问题.

I've setup a script which allows users to post messages to a fan page on Facebook. It all works but there's one small issue.

问题:

当帖子被添加到页面提要时,它会显示发帖用户的个人帐户.我希望它显示页面的帐户(例如,当您是该页面的管理员时,它说它来自该页面).我发布的帐户拥有该页面的管理员权限,但它仍显示为个人帖子.

When the post is added to the page feed it displays the posting user's personal account. I would prefer it to show the account of the page (like when you're admin of the page it says it came from that page). The account I'm posting with have admin rights to the page, but it still shows as a personal post.

HTTP POST

$url = "https://graph.facebook.com/PAGE_ID/feed";
$fields = array (
    'message' => urlencode('Hello World'),
    'access_token' => urlencode($access_token)
);

$fields_string = "";
foreach ($fields as $key => $value):
    $fields_string .= $key . '=' . $value . '&';
endforeach;
rtrim($fields_string, '&');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, count($fields));
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);

$result = curl_exec($ch);
curl_close($ch);

推荐答案

据我所知,你所要做的就是在你的调用中指定一个 uid(即页面的 ID)stream.publish

As far as I know, all you have to do is specify a uid (that is, the page's ID) in your call to stream.publish

看看模仿

这篇关于Facebook Graph Api - 以管理员身份发布到粉丝页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆