在不使用PHP-SDK的情况下发布到Facebook墙吗? [英] Post to Facebook wall without using PHP-SDK?

查看:69
本文介绍了在不使用PHP-SDK的情况下发布到Facebook墙吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不想将SDK添加到我的项目中,但是我想将消息发布到FB页面(公共页面,而不是/me). 据我了解,我需要像这样

I don't want to add SDK to my project, but I want to post messages to FB Page (public page, not /me). As I understood I need to do smt like this

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

我该如何获取访问令牌密钥? 当我使用请求中的令牌 https://graph.facebook .com/oauth/access_token?grant_type = client_credentials& client_id = xxx& client_secret = yyy ,它表示该令牌只能用于客户端信息(client_credintials). 我需要另一个grant_type或其他参数吗?

How I can get access token key for that? When I use token from request https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id=xxx&client_secret=yyy it says that it token can be used only for client info (client_credintials). I need another grant_type, or another params?

推荐答案

对于您的版本,您需要用户的publish_stream权限,该权限仅在您请求烫发后才有效.因此您将需要js SDK或php(或任何其他服务器端)SDK

for your version you would need the publish_stream permission from the user, which would only work if you have requested the perm. so you would need js SDK or php (or any other serverside) SDK

如果您仅访问以下网址,则可以使其更加简单:

you can make it even more simpler if you just to this 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

请参见 https://developers.facebook.com/docs/reference/dialogs/feed/ http://developers.facebook.com/docs /reference/javascript/FB.ui/了解更多示例.

see https://developers.facebook.com/docs/reference/dialogs/feed/ or http://developers.facebook.com/docs/reference/javascript/FB.ui/ for more examples.

这篇关于在不使用PHP-SDK的情况下发布到Facebook墙吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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