|
Beehive 2.0 REST API documentation
The following document describes the Beehive 2.0 REST API which supports both XML and JSON.
New feature:
- panel UI template save/query/delete
- openremote.zip upload/download
Index:
(1) Export a LIRC configuration as a text file, concatenate different RemoteSection.
- Parameters: ids (RemoteSection ids, separate by comma)
- Output:Combined Configuration files content as String.
(2) List all hardware vendors in the database
- Output:xml or json of a vendors list.
- Sample Response:
- content-type:application/xml
<vendors>
<vendor>
<id>1</id>
<name>3m</name>
</vendor>
<vendor>
<id>2</id>
<name>abit</name>
</vendor>
...
</vendors>
- content-type:application/json
- Errors:
- Error Code:204, No Content. See HTTP/1.1 documentation.If system has no Vendor at all.
(3) List all models of a vendor in the database
- Sample Response:
- content-type:application/xml:
<models>
<model>
<id>1</id>
<name>MP8640</name>
</model>
</models>
- content-type:application/json :
- Errors:
- Error Code:404, Not Found. See HTTP/1.1 documentation. If system can't find such a Vendor .
- Error Code:204, No Content. See HTTP/1.1 documentation. If this Vendor has no Model at all .
(4) List all RemoteSections of a model in the database
- Sample Response:
- content-type:application/xml:
<sections>
<section>
<id>1</id>
<comment>
#
# This config file has been automatically converted from a device file.
#...
</comment>
<name>MP8640</name>
<raw>false</raw>
</section>
</sections>
- content-type:application/json :
- Errors:
- Error Code:404, Not Found. See HTTP/1.1 documentation. If system can't find such a RemoteSection .
(5) List all RemoteOptions of a RemoteSection in the database
- Sample Response:
- content-type:application/xml:
<options>
<option>
<id>1</id>
<comment></comment>
<name>name</name>
<value>MP8640</value>
</option>
...
<options>
- content-type:application/json :
- Errors:
- Error Code:204, No Content. See HTTP/1.1 documentation. If this RemoteSection has no RemoteOption at all .
(6) List all Codes of a Section in the database
- Sample Response:
- content-type:application/xml:
<codes>
<code>
<id>1</id>
<comment></comment>
<name>STANDBY/ON</name>
<remoteName>MP8640</remoteName>
<value>0x000000000AF5E817</value>
</code>
...
</codes>
- content-type:application/json :
- Errors:
- Error Code:204, No Content. See HTTP/1.1 documentation. If this RemoteSection has no Code at all .
(7) List all icons identified by button command name (Included in M2)
- Sample Response:
- content-type:application/xml:
<icons>
<icon>
<id>21</id>
<fileName>http://localhost:8080/beehive/icons/menu.png</fileName>
<name>menu</name>
</icon>
...
</icons>
- content-type:application/json :
- Errors:
- Error Code:404, Not Found. See HTTP/1.1 documentation. If system can't find any icons.
- Error Code:204, No Content. See HTTP/1.1 documentation. If this button has no icons at all .
(8) List all icons (Included in M2)
- Sample Response:
- content-type:application/xml:
<icons>
<icon>
<id>1</id>
<fileName>http://localhost:8080/beehive/icons/power.png</fileName>
<name>power</name>
</icon>
<icon>
<id>2</id>
<fileName>http://localhost:8080/beehive/icons/home.png</fileName>
<name>home</name>
</icon>
...
</icons>
- content-type:application/json :
- Errors:
- Error Code:404, Not Found. See HTTP/1.1 documentation. If system can't find any icons.
- Error Code:204, No Content. See HTTP/1.1 documentation. If this button has no icons at all .
(9) Get all templates from account (Included in M7)
- Sample Response:
- content-type:application/xml:
<templates>
<template>
<id>3</id>
<content>content...</content>
<keywords>sony,tv</keywords>
<name>t3</name>
</template>
...
</templates>
- content-type:application/json :
- Errors:
- Error Code:401, unauthorized. See HTTP/1.1 documentation.
- Error Code:404, Not Found. See HTTP/1.1 documentation. If can't find any template.
(10) Save a template into account (Included in M7)
- Sample Response:
- content-type:application/xml:
<template>
<id>3</id>
<content>content...</content>
<keywords>sony,tv</keywords>
<name>t3</name>
</template>
- content-type:application/json :
- Errors:
- Error Code:401, unauthorized. See HTTP/1.1 documentation.
- Error Code:500, Server error. See HTTP/1.1 documentation.
(11) Update a template into account (Included in M7)
- Request Method: PUT
- Parameters: account_id(account id), template_id (template id)
- HTTP basic header Authorization : "Basic base64(username:md5(password,username))"
- Sample Request Url:http://localhost:8080/beehive/rest/account/1/template/1
- Output:xml or json of the updated template in account.
- Sample Response:
- content-type:application/xml:
<template>
<id>3</id>
<content>content...</content>
<keywords>sony,tv</keywords>
<name>t3</name>
</template>
- content-type:application/json :
- Errors:
- Error Code:401, unauthorized. See HTTP/1.1 documentation.
- Error Code:500, Server error. See HTTP/1.1 documentation.
(12) Delete a template from account (Included in M7)
- Errors:
- Error Code:401, unauthorized. See HTTP/1.1 documentation.
- Error Code:500, Server error. See HTTP/1.1 documentation.
(13) Upload template resource(images etc) into account (Included in M7)
- Errors:
- Error Code:401, unauthorized. See HTTP/1.1 documentation.
- Error Code:500, Server error. See HTTP/1.1 documentation.
(14) Download template resource(images etc) from account (Included in M7)
- Errors:
- Error Code:401, unauthorized. See HTTP/1.1 documentation.
- Error Code:404, openremote.zip not found. See HTTP/1.1 documentation.
(15) Upload account resource(openremote.zip for controller) into account (Included in M7)
- Request Method: POST
- Parameters: account_id(account id), template_id (template id), zip file (in MultipartForm)
- HTTP basic header Authorization : "Basic base64(username:md5(password,username))"
- Sample Request Url:http://localhost:8080/beehive/rest/account/1/openremote.zip
- Output: boolean result string.
- Errors:
- Error Code:401, unauthorized. See HTTP/1.1 documentation.
- Error Code:500, Server error. See HTTP/1.1 documentation.
(16) Download account resource(openremote.zip for controller) from account (Included in M7)
- Errors:
- Error Code:401, unauthorized. See HTTP/1.1 documentation.
- Error Code:404, openremote.zip not found. See HTTP/1.1 documentation.
(17) Search public templates by keywords from others (Included in M7)
- Sample Response:
- content-type:application/xml:
<templates>
<template>
<id>3</id>
<content>content...</content>
<keywords>sony,tv</keywords>
<name>t3</name>
</template>
...
</templates>
- content-type:application/json :
- Errors:
- Error Code:401, unauthorized. See HTTP/1.1 documentation.
- Error Code:404, Not Found. See HTTP/1.1 documentation. If can't find any template.
|
|
|
|
|