Facebook Graph API with PHP connection - php

i want to display facebook friends on my website and i want to use facebook graph api for that,
please
Thanks
Prakash
Facebook Graph API with PHP connection

This tutorial might help: Facebook PHP SDK
It includes example as well.

Generate an access token for yourself by going to https://developers.facebook.com/tools/explorer and then you may be able to retrieve your friends by accessing https://graph.facebook.com/_YOUR_USER_ID_/friends?access_token=xx and then the profile images can be retrieved using the following graph API call - https://graph.facebook.com/_FRIEND_PROFILE_ID_/picture?type=square
Of course, for more details, the Facebook Documentation (https://developers.facebook.com/docs/) is where you go to.

Related

php for instagram feed

I'm trying to embed an instagram feed on a webpage. I have gone through the steps on the instagram developer page to get an access token but I don't know what to do with it. Is there php code that you can suggest that I can use to create a feed by adding the user id and the access token?
Look at results here, Google is your friend :)
Example

Upload photo to facebook using Rest API

Can you please have a look to this URL
http://developers.facebook.com/docs/reference/rest/photos.upload/
I need to have a working example, how can I use this api to upload a photo to my facebook profile.
Actually I have a php site from where I want to allow users to upload photo to their facebook profile.
Thank you
The link you posted refers to an outdated approach to FB API. It's better to use the Graph API in conjunction with the latest PHP SDK.
http://developers.facebook.com/docs/reference/api/
https://github.com/facebook/php-sdk
here's a reference to the photo object methods
http://developers.facebook.com/docs/reference/api/photo/
Here's a fairly recent example from the facebook developers blog:
http://developers.facebook.com/blog/post/498/

Restricted Facebook Page Details over Graph API using PHP SDK

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.

How to Post to My Facebook Fan Page using PHP and Graph API?

i like to post to my FB Fan Page, Some Content using cron job in PHP,How can i do that?
Can you gave me example?
After becoming familiar with the Graph API check out Facebook's documentation for Pages
http://developers.facebook.com/docs/reference/api/page/
Here is the main page for Facebook's Graph API documentation
http://developers.facebook.com/docs/api
For PHP Development, check out this SDK, It will make your life much easier for interacting with Facebook using PHP
https://github.com/facebook/php-sdk/
Here is a link for how to configure your Facebook APP to be able to post on a Facebook Page
http://blog.theunical.com/facebook-integration/5-steps-to-publish-on-a-facebook-wall-using-php/
(I did not follow this exact tutorial but slaved to figure it out myself, so let me know how it works for you)
note As I mentioned in a below comment make special note of the permanent session key.

how to get a page owner feeds by facebook graph API

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

Categories