tags:

views:

37

answers:

1

How can I update my facebook tatus messages through the API?

There are a lot of examples around the net but all of they seem to be deprecated with the New Facebook API.

Regards!

A: 

A status message is now just a post. So you using the Graph API to publish a post to the user. You basically just need to do an HTTP POST to http://graph.facebook.com/PROFILE_ID/feed. The POST body should contain the value for the message. If you want the status to change you must only set the message. Here is how you would do it with PHP.

curl -F 'access_token=...' \
 -F 'message=Check out this funny article' \
 https://graph.facebook.com/me/feed

You can find more information about this here: http://developers.facebook.com/docs/reference/api/post

Nathan Totten
I'm having trouble with access_token, access_token must be obtained before setting up a new status message? I want my application to update users status without their login, they will trigger it remotely.
Andre
If you want to update the user's status without an active session you must request the "offline_access" extended permission when your client authenticates with your app. If you have the offline_access permission, the access token will never expire, so you can store it and use it whenever you need.
Nathan Totten
Is there any working PHP example that I can find? I can't find any
Andre
This page has everything you will need for authentication: http://developers.facebook.com/docs/authentication/
Nathan Totten
I guess I think how to do it... first I obtain the CODE and then I use the CODE to obtain the ACCESS_TOKEN. After this token, I have all that it takes to post in users wall.
Andre

related questions