如何以编程方式将喜欢的网页发布到 Facebook 提要?

2024-03-23

我正在努力让它发挥作用:https://developers.facebook.com/blog/post/465/ https://developers.facebook.com/blog/post/465/

Step 1:我正在获取访问令牌:

Step 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 http://example.com

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

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

Step 3:如果我首先将我的 url 发布到 linter,并获取其 ID:

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

https://graph.facebook.com/10150096126766188 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}}

来自Facebook Graph API 文档 https://developers.facebook.com/docs/reference/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 https://developers.facebook.com/docs/authentication/permissions

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

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何以编程方式将喜欢的网页发布到 Facebook 提要? 的相关文章

随机推荐