Posterous theme by Cory Watilo

Filed under: api

Are RESTful APIs replacing the term Web Services?

Recently Leonard Richardson, co-author or RESTful Web Services, has been wondering why people no longer appear to be referring to Web Services anymore ...

[...] I noticed that nobody uses the term "web services" anymore. Everyone talks about "APIs"

Now it is stretching things to say that "nobody uses the term" any more, when in fact there are still lots of occurrences, ranging from Cloud and mobile, through Cloud IDEs and including Social Networking. But Leonard's point is that the term is perhaps not being used as much as it once was.

The change I noticed is just that the terms used to be used interchangeably, and now "web service" has pretty much died out. When I say "web service" people know what I'm talking about, but I feel like I'm speaking out of a phrasebook, or doggedly saying "free software" in an "open source" world.

He wonders if this subtle change is indicative of something more fundamental and important going on within the industry? It is also true that the term "web service" used by REST proponents was never the same as the SOAP use of the same words. So is this something that is applicable only to the REST community? Is the apparent drop in use of the term in the SOAP community simply tied to the apparent downturn in the use of WS-*?

But Leonard wonders if this change is a problem?

[I believe] that there's a reason people might have stopped saying "web service" around 2007, but that using "API" as a generic term leads to products that are worse than they could be [...]

So is it really true that the term "web service" is dying out and being replaced by "API"? If so, why and what are the potential implications? Does this lead to poorer implementations due, presumably, to confusion arising around the term "API" as it applies to the Web? As one of the commenters on his original article states:

My understanding is that APIs don't self-describe. Obviously not all web services do either, but at least there exist standardized formats dedicated to description. As an anecdotal data point, though, we had a client hire us recently to write an app using their web service (not their API). It's SOAP, baroque and hideous, which probably has something to do with why they call it that. But I've certainly seen plenty of sites boasting about their APIs in the wild.

Facebook Graph API - The Future Of Semantic Web?

The new Graph API attempts to drastically simplify the way developers read and write data to Facebook. It presents a simple, consistent view of the Facebook social graph, uniformly representing objects in the graph (e.g., people, photos, events, and fan pages) and the connections between them (e.g., friend relationships, shared content, and photo tags).

Every object in the social graph has a unique ID. You can fetch the data associated with an object by fetching https://graph.facebook.com/ID. For example, the official page for the Facebook Platform has id 19292868552, so you can fetch the object at https://graph.facebook.com/19292868552:

{
   "name": "Facebook Platform",
   "type": "page",
   "website": "http://developers.facebook.com",
   "username": "platform",
   "founded": "May 2007",
   "company_overview": "Facebook Platform enables anyone to build...",
   "mission": "To make the web more open and social.",
   "products": "Facebook Application Programming Interface (API)...",
   "fan_count": 449921,
   "id": 19292868552,
   "category": "Technology"
}

Alternatively, people and pages with usernames can be fetched using their username as an ID. Since "platform" is the username for the page above, https://graph.facebook.com/platform will return what you expect. All responses are JSON objects.

All objects in Facebook can be accessed in the same way:

All of the objects in the Facebook social graph are connected to each other via relationships. Bret Taylor is a fan of the Coca-Cola page, and Bret Taylor and Arjun Banker are friends. We call those relationships connections in our API. You can examine the connections between objects using the URL structure https://graph.facebook.com/ID/CONNECTION_TYPE. The connections supported for people and pages include:

We support different connection types for different objects. For example, you can get the list of all the people attending the Facebook Developer Garage at SXSW (ID #331218348435) by fetching https://graph.facebook.com/331218348435/attending.

All of the different types of objects and connections we support are included in the Graph API reference documentation.

Contents

The Web is moving to a model based on the connections between people and all the things they care about. This is the future of the online world we live in.