Understanding the basic syntax of Facebook's Graph API is all you need to get started in Facebook development. Graph API's simple syntax is this:
Domain: This will always be https://graph.facebook.com/
Object: This can be any object on Facebook. You can choose a user name or id of an object. This can be a user, a Page, an event, a post — any single item on Facebook with an ID should work in this field.
Connection: After the object, you may specify elements of that object you would like to retrieve. This can be a feed or friends list, for example. Use metadata=1 as a parameter to learn what connections are available to the object you are accessing.
Parameters: Here you can specify specific parameters to return nuanced data from Facebook. Use the fields parameter, for instance, to designate what fields should be returned.
Now type these sample Graph API calls into your browser. You will quickly learn how easy it is to get started using Graph API!:
https://graph.facebook.com/dummiesbook — Returns data about this book's Facebook Page.
https://graph.facebook.com/dummiesbook/feed — Returns the feed (in paged format) for this book's Facebook Page.
https://graph.facebook.com/dummiesbook/picture — Returns the picture for this book's Facebook Page.
https://graph.facebook.com/http://staynalive.com — Returns data about my blog, as a Facebook Page.
https://graph.facebook.com/dummiesbook?metadata=1 — By specifying metadata=1, meta data will be returned specifying what connections are available for me to access about this book's Facebook Page.
dummies
Source:http://www.dummies.com/how-to/content/understanding-graph-api-or-facebook-development-sy.html
No comments:
Post a Comment