I'm trying to publish pictures on Facebook events under Facebook pages I own as that owning page using python. I am attempting to do so as the admin of an app.
The best understanding I have of the process (obviously not good enough) is that it is a two step process: 1) get page_token for target page using user_token (have a long-lived one) 2) use page_token to publish content.
Something like this:
def getFbGraph(accessToken=user_token):
return facebook.GraphAPI(access_token=accessToken)
page_token = getFbGraph().get_object(pageID, fields=['access_token'])
getFbGraph(page_token).put_object(parent_object=eventID, connection_name='photos', message='This is my caption', url=imgUrl)
That gets me the following error message:
facebook.GraphAPIError: Invalid OAuth access token
If instead I try to put the photo as a user (i.e. without the pageToken) I get the following message:
facebook.GraphAPIError: (#200) Requires extended permission: publish_actions
Is there no way for the admin of a page and an app to programmatically post allowed content? I don't need other FB users to be doing that (hence need to go through the publish_actions permissions) and I own all the pages I'm posting to.
Many thanks in advance for your comments.