Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Graph api How to get page ID via an access token

For "users" on Facebook, I gather information like their user ID by using this graph api call: https://graph.facebook.com/me?access_token=... This works every time.

My question is... is there a way to get the page information about the page that was just authorized via the access token that is returned after authorization?

I tried this, and id doesn't work, but this is what I'm looking for

https://graph.facebook.com/page?access_token=...

As you know, in order to post to a "page" wall is to 'Post' like so... https://graph.facebook.com/PAGEID/feed?message=blahblah&access_token=XXXXXXXXXXXXX

How do I get the page ID and other info about the page that was authorized without already knowing the ID or page "username" (which you have to have 25 likes to use anyway)???

Thank you for any help stackoverflow community:)

like image 756
wakurth Avatar asked Oct 10 '22 05:10

wakurth


1 Answers

The answer I was looking for is here. You can simply use a users access_token to get a set of their page_access_tokens, and give them the option of posting to these pages using these access tokens based on the return JSON object data.

like image 137
wakurth Avatar answered Oct 14 '22 04:10

wakurth