facebookfacebook-graph-apifacebook-opengraph

How do I add posts to my page through the Facebook api?


I've been trying to figure out the Facebook api for hours now and with all the markers, I get an answer: Unsupported get request. Object with ID '***' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api

I've already created about 5 different tokens on different pages, and I'm trying to execute code like this:

from facebook_business.adobjects.page import Page
from facebook_business.api import FacebookAdsApi

access_token = '***'
id = '***'
FacebookAdsApi.init(access_token=access_token, proxies=proxies)

fields = []
params = {}
print(Page(id).get_feed(fields=fields, params=params))

But all the time I get the same answer.

Does anyone know how to work with this? I have a page and I just want to add news to it through the api.


Solution

  • I'm back after a few days. What did I get with this interesting experience? Facebook made it a little confusing.

    The ID parameter in the url address DOES NOT equal the page or profile ID

    In the Graph API Explorer, in the "Access token" field, you must always enter the right token, even if the same token needs to be entered in the url, which means you simply duplicate the token in the url and in the field.

    On the one hand understandable, but on the other hand a bit confusing documentation, where probably everyone may have questions like "And how do I do that?"

    All in all, I managed to do it successfully once and I don't want to repeat this experience any time soon. Records can publish through the api and this is the main thing. Thank you all.