5
votes

I am having trouble getting the hang of the facebook graph API and reading my wall post.

I've created a facebook app and from it now have an App ID and AppSecret, using those, I get an access_token via this url: https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id=MYAPPID&client_secret=MYAPPSECRET

example: access_token=12313231321312312312

so then I make the call here:

https://graph.facebook.com/MYFACEBOOKID/feed?access_token=12313231321312312312

however the results I see are not the list of items that are on my wall. Example I made a post today and it's not in that result. The only thing listed there is a friend I added about 2 weeks ago, and nothing else.

If I go to https://developers.facebook.com/tools/explorer and type in the textbox put in /MYFACEBOOKID/feed and submit, then I see the full results of what I would like to get above (using the app secret etc). If I copy the access_token from the explorer page and put that into my url, then I also get the full results.

So wondering what am I missing? Do I need to add permissions somewhere, so I can get the same results using the AppID/AppSecret method to request the access_token?

Or do I just use the access_token from the explorer page in my code?

1
I guess what I am wondering if I need to do grab the access_token using AppID/AppSecret, or if I should just use the access_token on the graph explorer pageKaren
I have the same issue! did you solve it?Matías Cánepa
Pretty sure I ended up using the oAuth stuff via AppID and AppSecretKaren

1 Answers

1
votes

grabbing the access token from the graph explorer is not an answer. You can check though and see if the access token there (select your app, not the graph) is the same that you get with the url. For the authorization URL, have you tried something like the following?

https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&scope=user_likes,user_status,publish_actions,read_stream,ETC_ETC_OR_WHATEVERELSE&response_type=token"

This works fine for me so it's worth giving a try. I also see here that it can still be done this way (not considered bad practice as far as I can see). Yes you need permissions in other words.