What facebook API do I use to remotely publish things to user's walls from my FB App?

这一生的挚爱 提交于 2019-12-25 04:21:40

问题


I have a FB App that a user will subscribe to via some client (Android or Web), but that later needs to post stuff to their wall (not from the client but from the server). Assuming I have the FB-AppID, and Key and the user's UserId, and they have opted into the app, what is the API I would use to then post stuff to their wall via WGET from my server? I'm confused by all their various methodologies, and am hoping to get pointed towards the one that's the most HTTP friendly.


回答1:


Please check out the "posts/Create" section under https://developers.facebook.com/docs/reference/api/user/.

You will need publish_stream permission to push the same to facebook.

Also, you will need a valid access_token from FB which is linked to the user who has logged into your app. A standard access_token will work only for a fixed amount of time since it was last provided to you (typically 30 minutes).

If you wish to post after the said time (basically anytime), then you will need the offline_access permission also.

In essence, if you need to do a post offline, then you need to necessarily have an access token with both "offline_access" and "publish_stream" permissions.




回答2:


You can use Facebook Graph API. This api is HTTP based and support REST services.

Here is the link -> https://developers.facebook.com/docs/reference/api/ You must be login in Facebook to access this page.



来源:https://stackoverflow.com/questions/9597707/what-facebook-api-do-i-use-to-remotely-publish-things-to-users-walls-from-my-fb

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!