So I'm trying to obtain a list of posts from a Facebook page that I have created. After reading the documentation, I need to provide a user access token / page token to each API request in order to get the data. The documentation states that the user access tokens & page access tokens come in two variants:
The application I am building is a aggregated news (Facebook, twitter and Instagram) feed that will be displayed to users on my website.
From what I have read, the app tokens don't have an expiration but cannot access the pages API.
Do Facebook really expect application owners to remember to manually update their keys every 90 days in order to keep the applications working, or am I missing something that I can do to automate this?
If it is only about your Page, you are not missing anything, and there is no way to automate generating tokens - that would make expiration dates pointless. You can only send yourself a reminder before it expires. But: It can also expire if your change your Facebook Password, for example. It would be a good idea to implement a proper error handling so you get a message when the Token does not work anymore.
If it is about other Pages too, you can apply for Page Public Content Access and use an App Token that is valid forever.
Am I right in saying that if I make my page public and I apply for
Page Public Content Access
, I can then access the public posts of my page and any other public page while using an app token (that lasts forever)?pages are public by definition ;) - (unless they are restricted by age or location, to be specific). facebook will not allow you usage of PPCA though, if it is only for your own page.
So
Page Public Content Access
only gives me access to view other peoples pages posts but not my own? That seems convoluted?No, what luschn meant, is Facebook will not approve your app’s use of that feature, if the purpose of your app is to only get data from the pages you yourself manage. In that case, you are supposed: to use your page token.
@04FS will attaching the page to the app allow me to query data from it without a user token? I essentially have a server application that just needs to query public data from a page that I own. I don't see a feasible way of doing this other than applying for page public content access, as manually renewing the user access token and page access token ever 2 months isn't self sustaining.