Learn More

Thursday, August 2, 2012

Understanding the Graph API Facebook

facebook login
On facebook, everyone connected with everything they care about. This concept is the core of the facebook social graph. For third-party applications that want to access the social graph, then it must apply the Graph API. Each object in the social graph always has a unique ID, Graph API will access the object based on a unique ID. The object referred to the social graph are: you, your applications, your friend, and others. You who have accounts on facebook, will automatically have a unique ID. The format Graph API is a secure network, we can use the Graph API through FB.api. For example, the Graph API to your ID has a format like the following
https://graph.facebook.com/YourID 

However, if you want to access the Graph API to private property, you can replace YourID with me. Consider the following format Graph API

https://graph.facebook.com/YourID has same meaning with https://graph.facebook.com/me

All objects in the social graph are connected through relationship. Suppose you like the application threelas.com then you can access it through the Graph API Connection. In general, form of the Graph API connection is as follows

https://graph.facebook.com/ID/Connection 

Another example, suppose you want to access your friends via the Graph API, then the format of the Graph API is as follows

https://graph.facebook.com/me/friends?access_token=AccessTokenValue 

Yes, you need the access token. Not all objects need access token, depending on setting you or your friends facebook account. If you are setting an object with public. Then you do not need an access token. Output of Graph API is a JSON. For those of you who want to learn more about JSON, you can learn through http://www.w3schools.com. By default, each object is requested will feature most of the connection. However, sometimes you do not need to use the Graph API Connection. You can do it another way, the Graph API Selections. Consider one example of the following Graph API Selections.

https://graph.facebook.com/ID?fields=id,name,picture 

has same meaning with 

https://graph.facebook.com/ID/picture 

There are so many formats of Graph API with Connections. My advice if you want to know more, you can read it through Graph API Facebook. Next topic, I will explain how to use Graph API with FB.api and Jquery.

Post a Comment