I have been looking for documentation on how to post a message to a group wall on Facebook using Python and the Facebook API to no avail or the documentation has not been clear on what permissions i need to have set.
How can i go about this?
This is my current code.
from facepy import GraphAPI
graph = GraphAPI(graphApiAccessToken)
graph.post(path = 'groups/GROUPNAME', message='Hello world')
First of all, try to use the official Python Facebook Client.
The API for publishing to a group is here.
The rough code will look like:
graph = facebook.GraphAPI(oauth_access_token)
groups = graph.get_object("me/groups")
group_id = groups['data'][0]['id'] # we take the ID of the first group
graph.put_object(group_id, "feed", message="from terminal")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With