Saturday, May 9, 2015

In today's post we will be reviewing the Open Graph protocol as described online. We will review what's mentioned on the web and then we will explore some from their GitHub.  Graphs provide a very intuitive and wholesome representation of the data such as in web pages particularly social media such as Facebook. Its not that relational, no-sql or object databases don't serve as a good store for the computations of the social media, they don't simply provide a single technology for a developers to interact with. Consequently the graph protocol and its API enters the picture. By converting the data in the web pages and the social accounts into a graph, we can enable more such functionalities as multiple posts and multiple comments. The relationship between the graph objects allows us to do CRUD operations on these objects.
Facebook Graph API comprises of the following:
1) nodes - these pertain to resources such as a User or a Photo, a page or a Comment
2) edges - the connections between those resources such as a Page's photos or a Page's comments.
3) fields - the things such as the birthday of the User
The Graph API is HTTP based and follow the REST paradigm and conventions. For Example, GET /me will return your profile information. APIs are available are comprehensive and distributed into core and extended set of APIs. APIs are also authorized and require an access_token.
Subsequently the objects were versioned with /v2.1/{object}
Core API's and SDKs are central to the Facebook Platform. These elements are subject to a version system and gurantee that anything considered a code API node, field, edge dialog, SDK or SDK method will remain unavailable and unchanged for a span of two years from the version release.  Breaking changes come via new version.
Core Elements include Facebook login, share dialog, requests dialog, the like button, the Facebook SDK for iOS, the Facebook SDK for Android, some methods of the Facebook SDK for JavaScript and Some Graph API fields and endpoints.
Extended is everything beyond that, APIs and SDKs.  The extended are subject to variation within 90 days.
APIs can be simply read-based. In addition, we can choose fields to make a query.
Objects can also be discovered by their IDs. But sometimes this is not possible. In such cases, we can use the URL node to return the IDs of Open Graph Object URLs or find data associated with an App Link URL.  We can even retrieve multiple objects with object type such as
GET /me/{action-type}/{object-type}
App Link URLs take the form :
GET graph.facebook.com?ids=http://fb.me/<id>/&fields=app_links&access_token=<access_token>

While we continue our discussion on Graph API of Facebook, we can also take a look at some of the simple Graph methods as implemented here:

https://github.com/ravibeta/csharpexamples/tree/master/CodingExercises/CodingExercises
And how graph apis work at :  http://1drv.ms/1PxFU

Coming back to our discussion on FaceBook Graph API, let's us explain the App Link a bit more since it's a FaceBook concept and not a general concept we have been discussing so far. App Links enables deep link to content in our Facebook app. With this kind of sharing it is possible to jump to and from the Facebook application to the App Links App. Moreover the content is brought into the Facebook App. It works by adding metadata to existing URLs on the web so that they can be consumed by our Facebook App. 

No comments:

Post a Comment