Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Cabinet

...

URL

...

http://<<ip address>>/rest/cabinet

...

Method

...

GET

...

Description

...

Receives information on the cabinet.

...

Response

...

Code Block
languagejson
{
  "planks": «numberofplanks», 
  "sections": «numberofsections»,
  "name": «nameofcabinet»,
  "status": [«listofhumanreadablestatusmessages»]
}

Status message can be:

  • Missing tag at plank P, section S (Tag ID N)

  • No connection to controller

When list of messages is empty, cabinet is “OK”.

...

Status

...

Status
colourGreen
titleimplemented

...

URL

...

http://<<ip address>>/rest/cabinet

...

Method

...

PUT

...

Description

...

Stores information on the cabinet.

...

Request

...

Code Block
languagejson
{ 
  "planks": «numberofplanks», 
  "sections": «numberofsections»,
   "name": «nameofcabinet»
}

...

Response

...

HTTP204 when successful

...

Possible Errors

...

HTTP400 when request was invalid

Code Block
languagejson
{
  "message": «human readable error»
}

...

Status

...

Status
colourGreen
titleimplemented

...

URL

...

http://<<ip address>>/rest/cabinet/lighttest

...

Method

...

PUT

...

Description

...

Sets the cabinet is lighttest mode: turning light on or off. The light test shows the tag’s address.

...

Request

...

Code Block
languagejson
{ 
  "mode": "on" | "off"
}

...

Response

...

HTTP204 when successful

...

Possible Errors

...

HTTP400 when request was invalid

Code Block
languagejson
{
  "message": «human readable error»
}

...

Status

...

Status
colourGreen
titleimplemented

...

URL

The REST interface enables any programmer to directly control the PTL Cabinet.

The base address is http://<<ip address>>/rest

...

Method

...

PUT

...

Description

...

Sets the cabinet in or out of teach mode.

...

Request

...

Code Block
languagejson
{ 
  "mode": "on" | "off"
}

...

Response

...

HTTP204 when successful

...

Possible Errors

...

HTTP400 when request was invalid

Code Block
languagejson
{
  "message": «human readable error»
}

...

Status

...

Status
colourRed
titlenot in prototype

...

URL

...

http://<<ip address>>/rest/cabinet/teach

...

Method

...

GET

...

Description

...

Get current state of teach mode

...

Responses

...

HTTP204 when not in teach mode

HTTP200 when in teach mode, with following body:

Code Block
languagejson
{
  "tag": [«list of tags found»]
}

...

Status

...

Status
colourRed
titlenot in prototype

Demo

These REST calls define separate demo modes for the cabinet. Note they do not work all in the same way. Some might have state, some don’t.

...

URL

...

http://<<ip address>>/rest/cabinet/demo/random-pick

...

Method

...

PUT

...

Description

...

Switches on 3-6 random lights, with a number randomised between 1 and 5. This demo is disabled by switching all lights off (see lighttest above), or by pushing all lights.

This demo mode is stateless.

...

Request

...

Ignored

...

Response

...

HTTP204 when successful

...

Possible Errors

...

None

...

Status

...

Status
colourGreen
titleimplemented

Section

Plank and section numbering is 1-based. So if 4 planks are available, they are numbered 1 to 4.

...

URL

...

http://<<ip address>>/rest/plank/«plankno»/section/«sectionno»[/side/«side»]

...

Method

...

GET

...

Description

...

Receives information of section.

plankno and sectionno are numbers

side can be front or back and is optional; when not supplied, this defaults to front.

...

Response

...

Code Block
languagejson
{
  "value": «lastdisplayedvalue»,
  "state": «state»
}

...

Possible Error

...

HTTP404 with no body when section does not exist.

...

Status

...

Status
colourGreen
titleimplemented

...

URL

...

http://<<ip address>>/rest/plank/«plankno»/section/«sectionno»[/side/«side»]

...

Method

...

PUT

...

Description

...

Sets value on display.

plankno and sectionno are numbers

side can be front or back and is optional; when not supplied, this defaults to front.

...

Request

...

Code Block
languagejson
{
  "value": «valuetodisplay»
}

...

Response

...

HTTP204 when successful

...

Possible Errors

...

HTTP400 when request was invalid

Code Block
languagejson
{
  "message": «human readable error»
}

HTTP404 with no body when section does not exist

...

Status

...

. The REST interface has the following actions available:

Child pages (Children Display)