W3C home > Mailing lists > Public > public-device-apis@w3.org > October 2009

Re: [Policy] identifying APIs

From: John Kemp <john@jkemp.net>
Date: Tue, 6 Oct 2009 19:52:18 -0400
Cc: Frederick Hirsch <frederick.hirsch@nokia.com>, W3C Device APIs and Policy WG <public-device-apis@w3.org>
Message-Id: <39BF6D4A-9F85-4214-8EFB-C49DDD492AF3@jkemp.net>
To: Marcin Hanclik <Marcin.Hanclik@access-company.com>
Hey Marcin,

On Oct 6, 2009, at 5:35 PM, Marcin Hanclik wrote:

> Hi John,
>
> Would it be possible for you to share [API]?

http://jkemp.net/tag/apis-on-the-web.html on my personal website.

>
> Why would we need APIs to be resources? (I know it is possible,  
> but ...)

I don't think you'd need to have it be that way, but I was just  
imagining what it would be like if you were to imagine a 'My Calendar'  
resource, and give it a URI. If you operated an HTTP server on your  
device, you could give out a URI something like (just an example) http://my-device/Calendar/today 
  to get a list of calendar entries for that day.

You could also imagine calling a function - 'calendar.entries( new Date 
() ) ;' to return exactly the same information - a representation of  
the same resource pointed to by the URI noted above.

I'm not sure if this is useful per se, but for me it reconciles the  
RESTful with the "scriptful" somewhat if you imagine that the result  
of a JS call is a representation of the same resource used to fulfill  
a request to a particular URI.

Cheers,

- johnk
Received on Tuesday, 6 October 2009 23:52:52 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:53:39 UTC