开发者

How could I get access token for another user (from my app)?

开发者 https://www.devze.com 2023-01-31 08:56 出处:网络
I would like post some message as another user (not current开发者_JS百科ly using the app). Is it possible? Of course, I would like use user which allow to get access my app.When a user goes to your ap

I would like post some message as another user (not current开发者_JS百科ly using the app). Is it possible? Of course, I would like use user which allow to get access my app.


When a user goes to your app, you can ask him for the extended permissions 'offline_access' and 'publish_stream'. With these permissions, you should be able to post as that user, even if he is not currently visiting the app.
More info about extended permissions can be found at http://developers.facebook.com/docs/authentication/permissions

edit:

You can publish to the Facebook graph by issuing HTTP POST requests to the appropriate connection URLs, using an access token on behalf of the user or an application access token (for Open Graph Pages). For example, you can post a new wall post on Arjun's wall by issuing a POST request to https://graph.facebook.com/arjun/feed:

curl -F 'access_token=...' \
      -F 'message=Hello, Arjun. I like this new API.' \
      https://graph.facebook.com/arjun/feed

so basically you retrieve the access token when the user authorizes your application, and store it for later use.

Quote found at http://developers.facebook.com/docs/api

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号