Changes between Version 1 and Version 2 of API

Show
Ignore:
Timestamp:
05/31/09 19:35:02 (16 months ago)
Author:
rsm
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • API

    v1 v2  
    66 
    77== Introduction == 
    8 The communication wiki:API is used by ''components'' to communicate with !GoodRobot.com server, for controlling a remote Robot or a robot to receive control inputs. wiki:Components are hardware or software units, that communicate with !GoodRobot.com server and examples include a robot, web page, arduino with ethernet shield, special hardware that sends/receives control/sensor information, twitter and pachube front-end or any custom components that intends to integrate itself with the !GoodRobot setup. The !GoodRobot.com team will provide several components and allows third party to create custom components, provided they have the ability to integrate with GoodRobot.com using the API being described below. 
     8The communication [wiki:API API] is used by ''components'' to communicate with !GoodRobot.com server, for controlling a remote Robot or a robot to receive control inputs. [wiki:Components Components] are hardware or software units, that communicate with !GoodRobot.com server and examples include a robot, web page, arduino with ethernet shield, special hardware that sends/receives control/sensor information, twitter and pachube front-end or any custom components that intends to integrate itself with the !GoodRobot setup. The !GoodRobot.com team will provide several components and allows third party to create custom components, provided they have the ability to integrate with GoodRobot.com using the API being described below. 
    99 
    1010== Usage Scenario == 
     
    1212This API is used while both sending data from a component to the !GoodRobot.com and receiving data from the !GoodRobot.com server. 
    1313 
    14 This wiki:API is also used by programs that query the !GoodRobot.com server for specific historical information, that is provided by !GoodRobot.com server. The details of such historical or even current data, that is provided through this wiki:API, is described [wiki:ReportsAPI here]. 
     14This [wiki:API API] is also used by programs that query the !GoodRobot.com server for specific historical information, that is provided by !GoodRobot.com server. The details of such historical or even current data, that is provided through this [wiki:API API], is described [wiki:ReportsAPI here]. 
    1515 
    1616== Protocol == 
     
    1818The API is a RESTful interface. From Wikipidea, '''''Representational state transfer (REST)''' is a style of software architecture for distributed systems such as the World Wide Web''. REST, in itself, is not a protocol per se, but is a loose definition of how resources are defined and addressed. In simple words, REST can be loosely defined as sending and receiving XML data over HTTP interface. 
    1919 
    20 As per the !GoodRobot wiki:API, components act as the client and thus initiating the transaction with the !GoodRobot.com server. wiki:Components needs to use PUT or POST method of HTTP protocol to send data and GET method of HTTP protocol to receive data. In most cases, the use of PUT method (which is used to send data) will also result in appropriate response, thus avoiding the necessity for an additional call to the GET method. The DELETE method is not used. 
     20As per the !GoodRobot [wiki:API API], components act as the client and thus initiating the transaction with the !GoodRobot.com server. [wiki:Components Components] needs to use '''PUT or POST''' method of HTTP protocol to send data and GET method of HTTP protocol to receive data. In most cases, the use of PUT method (which is used to send data) will also result in appropriate response, thus avoiding the necessity for an additional call to the GET method. The DELETE method is not used. 
    2121 
    2222The URI, passed in the HTTP message, will have these specific information:  
     
    5757== Security and Authentication == 
    5858 
    59 For enhanced security, all wiki:Components need to authenticate themselves with !GoodRobot.com server. Authentication is achieved by passing a special key to the !GoodRobot.com server, which is used to authenticate the particular instance of a component. HTTP messages that fail authentication will be replied with '__401 Unauthorized__' response. 
     59For enhanced security, all [wiki:Components Components] need to authenticate themselves with !GoodRobot.com server. Authentication is achieved by passing a special key to the !GoodRobot.com server, which is used to authenticate the particular instance of a component. HTTP messages that fail authentication will be replied with '__401 Unauthorized__' response. 
    6060 
    6161There are two modes of key based authentication that is used:  
     
    6363 b. a signature key (which is a digital signature, based on the public/private key pair, signed using the contents) 
    6464 
    65 wiki:Components can choose to use any one form of authentication key. In both cases, the key is passed as a custom HTTP header. In the case of fixed secret key, the header used is '''X-!GoodRobotKey''' and in the case of signature key, the header used is '''X-!GoodRobotSignature'''. In some rare cases, where the components do not have ways to send custom HTTP headers, they can pass the key as part of the URI – though this is deprecated. 
     65[wiki:Components Components] can choose to use any one form of authentication key. In both cases, the key is passed as a custom HTTP header. In the case of fixed secret key, the header used is '''X-!GoodRobotKey''' and in the case of signature key, the header used is '''X-!GoodRobotSignature'''. In some rare cases, where the components do not have ways to send custom HTTP headers, they can pass the key as part of the URI – though this is deprecated. 
    6666 
    6767The fixed secret key is created and maintained in the [wiki:GRAdmin Admin] pages of !GoodRobot.com server, for each instance of the component. The component needs to send the same exact key, as is maintained in the !GoodRobot.com server. However, the fixed secret key method is not really a secure solution as someone could read the HTTP packets, which are sent in plain text. For those who wish to have a better solution, they can use SSL HTTP (“https://” instead of “http://”) to connect to the !GoodRobot.com server.