Nick Badal
Nick Badal

Reputation: 671

How do I get an auth token for a facebook page if my app has been added to it?

My app's only purpose is to make posts as Facebook pages, so we'd like to take user login out of the flow.

If the user adds our app to their page using a link like http://facebook.com/add.php?api_key=APP_KEY&pages=1, how would I get an access token to make posts as that page?

Thanks :)

Upvotes: 1

Views: 747

Answers (1)

DMCS
DMCS

Reputation: 31870

At least one of the page's admins has to authorize your app with both manage_pages and publish_stream permissions. (see https://developers.facebook.com/docs/reference/api/permissions/)

Then once you get their access token, call the graph with me/accounts and in that list will be the page. (see the Page Login section of https://developers.facebook.com/docs/authentication/) In there will be a page access token for managing that page. So then you can HTTP Post to me/feed a new message using that page access token.

Happy coding!

Upvotes: 1

Related Questions