Can I fetch facebook fanpage posts with graph https://graph.facebook.com/ using php when I try curl on this I get blank/no-response
I like to avoid using fb token if possible otherwise would like to use latest php sdk
You can just use an App Access Token for this:
https://graph.facebook.com/page-id/feed?access_token=APP-ID|APP-SECRET
...or if you only want to get the posts from the Page, without the User posts:
https://graph.facebook.com/page-id/posts?access_token=APP-ID|APP-SECRET
More information: https://developers.facebook.com/docs/graph-api/reference/v2.2/page/feed
Related
I've recently been working with the graph API for Facebook and i want to create a script that lets me input a page_id and will then return the like count of the specified page.
I've already taken care of getting an access token and logging in, but i can't seen to find anything concerning the total like count of a page in the Reference.
This would be the API call:
https://graph.facebook.com/bladauhu?fields=fan_count&access_token=xxx
You can use any Token if the Page is not restricted by age or location. If it is restricted, you need a User or Page Token of a user who can see the Page.
More information:
http://www.devils-heaven.com/facebook-access-tokens/
https://developers.facebook.com/docs/facebook-login/access-tokens/
I am using PHP to work on Facebook, and I want to get an access_token to get User Data Permission for items like
email
user_actions.music
user_activities
user_events
user_location
etc.
I know this can be done by using Graph API Explorer in Facebook developers. Can you show me how to do this in PHP? Thanks!
After include'ing the Facebook SDK for PHP, simply call $facebook->getLoginUrl with appropriate parameters.
I'm trying to use Facebook's PHP SDK to get the number of likes for a fan page. This works fine for most pages, but some pages are returning false because they have age restrictions. Using the PHP SDK, how do I get the number of likes for an age restricted fan page over the graph API?
I'm currently not using an access token to read the pages. Would an app access token work? And if so how do I use an app access token with the PHP SDK.
Restricted pages can be read using the graph api but it requires a user's access token. I had tried it with an app access token which does not work.
The relevant documentation can be found here: https://developers.facebook.com/docs/reference/api/page/
You should to use Page access token. To get list of your pages with access tokens, use me/accounts method of the Graph API.
i use this code to authorize me with my app
https://graph.facebook.com/oauth/authorize?client_id=myappid&scope=publish_stream,offline_access,manage_pages&method=post&redirect_uri=http://www.site.com/indexold.html
i get the access token and i use this to do the Impersonation trick
https://graph.facebook.com/oauth/access_token?client_id=myappid&client_secret=myappsecret&redirect_uri=http://www.poemsofloveapp.com/indexold.html
lastly i use this to post to my page ... not the app page but a page i have created
https://graph.facebook.com/mypageid/feed?access_token=1234|asdasdasdasd&message=hello%20world&method=post
the post is successful but it is shown as i have posted it . i want the profile picture of the group to be shown next to the post is this possible? instead mine is shown next to the post!
What you are looking for is called impersonation in facebook graph api terminology.
Check here
And, also here
i'm trying to get a facebook page feeds using graph URL. but i want to get only the owner data ... i don't want anything not from the owner. i can do that using PHP. but i'm asking if i can do that using the same graph request.
Thanks
Just use /posts instead of /feed