0

我试图让它工作:https ://developers.facebook.com/blog/post/465/

第 1 步:我正在获取访问令牌:

https://graph.facebook.com/oauth/access_token?type=client_cred&client_id=myAppIdclient_secret=myAppSecret

第 2 步:我通过 curl 发布

curl -F 'access_token=myAccessToken'  -F 'message=Hello World!'  -F 'id=http://example.com'  https://graph.facebook.com/feed

myUrl 在哪里说http://example.com

我收到此错误,无法解析为有效的用户 ID:

{"error":{"message":"(#100) http:\/\/example does not resolve to a valid user ID","type":"OAuthException","code":100}}

第 3 步:如果我首先将我的 url 发布到 linter,并获取它的 ID:

https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fexample.com

https://graph.facebook.com/10150096126766188

curl -F 'access_token=myAccessToken'  -F 'message=Hello World!'  -F 'id=10150096126766188'  https://graph.facebook.com/feed

然后我收到“用户尚未授权应用程序执行此操作”错误:

{"error":{"message":"(#200) The user hasn't authorized the application to perform this action","type":"OAuthException","code":200}}
4

2 回答 2

0

按照博客文章,这是通过应用程序完成的,为此,应用程序需要扩展权限“publish_actions”和“publish_stream”才能发布帖子/评论/喜欢/链接

于 2012-05-02T20:05:18.853 回答
0

来自Facebook Graph API 文档

Most write operations require extended permissions[1] for the active user.
See the authentication guide[2] for details on how you can request extended
permissions from the user during the authentication step.

1 https://developers.facebook.com/docs/authentication/permissions

2 https://developers.facebook.com/docs/authentication/

于 2012-05-02T18:20:39.203 回答