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 をリンターに投稿し、その 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

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 に答える
0

ブログの投稿を見ると、これはアプリを介して行われます。これを機能させるには、投稿/コメント/いいね/リンクを作成するために、アプリに拡張アクセス許可「publish_actions」と「publish_stream」が必要です。

于 2012-05-02T20:05:18.853 に答える