Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

REST API: Methods

pakerfeldt edited this page Jan 4, 2011 · 4 revisions

GET on

Description: Turns the specified device on
URL: GET /devices/<id>/on.<format>
Formats: xml
Requires Authentication: Yes*
Specific Error States:

  1. 400 (HTTP) 210 (ERROR) if the id is malformed.
  2. 400 (HTTP) 220 (ERROR) if the method is not supported.
  3. 400 (HTTP) 300 (ERROR) if libtelldus-core returns an error.

Usage Examples:

curl -u user:pass http://localhost:8080/devices/1/on.xml
(empty response)

GET off

Description: Turns the specified device off
URL: GET /devices/<id>/off.<format>
Formats: xml
Requires Authentication: Yes*
Specific Error States:

  1. 400 (HTTP) 210 (ERROR) if the id is malformed.
  2. 400 (HTTP) 220 (ERROR) if the method is not supported.
  3. 400 (HTTP) 300 (ERROR) if libtelldus-core returns an error.

Usage Examples:

curl -u user:pass http://localhost:8080/devices/1/off.xml
(empty response)

GET dim

Description: Dims the specified device to the specified level (0 – 255)
URL: GET /devices/<id>/dim/<level>.<format>
Formats: xml
Requires Authentication: Yes*
Specific Error States:

  1. 400 (HTTP) 210 (ERROR) if id or level is malformed.
  2. 400 (HTTP) 220 (ERROR) if the method is not supported.
  3. 400 (HTTP) 300 (ERROR) if libtelldus-core returns an error.

Usage Examples:

curl -u user:pass http://localhost:8080/devices/1/dim/42.xml
(empty response)

GET learn

Description: Triggers learn on the specified device.
URL: GET /devices/<id>/learn.<format>
Formats: xml
Requires Authentication: Yes*
Specific Error States:

  1. 400 (HTTP) 210 (ERROR) if id is malformed.
  2. 400 (HTTP) 220 (ERROR) if the method is not supported.
  3. 400 (HTTP) 300 (ERROR) if libtelldus-core returns an error.

Usage Examples:

curl -u user:pass http://localhost:8080/devices/1/learn.xml
(empty response)
Clone this wiki locally