Facebook graph api 不使用PHP-SDK发布到Facebook墙?

Facebook graph api 不使用PHP-SDK发布到Facebook墙?,facebook-graph-api,Facebook Graph Api,我不想将SDK添加到我的项目中,但我想将消息发布到FB页面(公共页面,而不是/me)。 据我所知,我需要这样做smt curl -F 'access_token=...' \ -F 'message=Check out this funny article' \ -F 'link=http://www.example.com/article.html' \ -F 'picture=http://www.example.com/article-thumbnail.jp

我不想将SDK添加到我的项目中,但我想将消息发布到FB页面(公共页面,而不是/me)。 据我所知,我需要这样做smt

curl -F 'access_token=...' \
     -F 'message=Check out this funny article' \
     -F 'link=http://www.example.com/article.html' \
     -F 'picture=http://www.example.com/article-thumbnail.jpg' \
     -F 'name=Article Title' \
     -F 'caption=Caption for the link' \
     -F 'description=Longer description of the link' \
     -F 'actions={"name": "View on Zombo", "link": "http://www.zombo.com"} \
     -F 'privacy={"value": "ALL_FRIENDS"} \
     https://graph.facebook.com/me/feed
我如何才能获得访问令牌密钥? 当我使用来自请求的令牌时,它表示它的令牌只能用于客户端信息(客户端凭据)。
我需要另一个授权类型,或另一个参数?

对于您的版本,您需要用户的发布流权限,只有在您请求perm时才有效。因此,您需要JSSDK或php(或任何其他服务器端)SDK

如果您只需访问以下url,则可以使其更加简单:

http://www.facebook.com/dialog/feed?
  app_id=123050457758183&
  link=http://developers.facebook.com/docs/reference/dialogs/&
  picture=http://fbrell.com/f8.jpg&
  name=Facebook%20Dialogs&
  caption=Reference%20Documentation&
  description=Dialogs%20provide%20a%20simple,%20consistent%20interface%20for%20applications%20to%20interact%20with%20users.&
  message=Facebook%20Dialogs%20are%20so%20easy!&
  redirect_uri=http://www.example.com/response

有关更多示例,请参见或。

我只想知道:

1) 在对话框中验证应用程序:

https://www.facebook.com/dialog/oauth?client_id=xxx&scope=publish_stream,offline_access&redirect_uri=http://site.com
2) 获取“永久”访问令牌:

https://graph.facebook.com/oauth/access_token?client_id=xxx&client_secret=yyy&code=zzz&redirect_uri=http://site.com
3) 贴到墙上:

https://graph.facebook.com/me/feed?access_token=aaa&message=msg

但我想这就是我使用访问令牌的原因。在我们的“类似facebook”的社交网络中,我只需要为我的应用程序获取一次令牌,然后用它来发布消息。或者你是想用“你的”名字发布到facebook上吗。就像来自CMS的自动交叉帖子。这会起作用,但您需要一个sdk。(你“可以”做它,但它的更多的工作)是的,在我的名字,但不是我的墙。正如我所说,我不想使用SDK(我看到的无用代码)。好吧,尽情阅读吧,你需要创建一个应用程序,获取一个应用程序访问令牌,你的用户需要相应的权限。之后,你可以发布到你的用户墙、你管理的粉丝页面(以及你的朋友墙),而无需登录。但这一点在这里需要考虑的太多了。