Versions Compared

Key

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

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»],
  "demo": "random-pick|barcode|off",
  "
mode
sides": "
section|tag"
frontonly|frontandback",
  "orders": «number of open orders»,
  "
sides
tagmode": "
frontonly|frontandback
pick|zeropick|confirm|info|locked"
}

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”.

De demo mode tells in which (stateful) demo mode the cabinet is, of off when not in demo mode. Use the calls in Demo to manipulate these modes.

Status

StatuscolourGreentitleimplemented

Remarks

v2.0:

  • mode was removed

v2.1:

  • orders and tagmode added

URL

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

Method

PUT

Description

Stores information on

the cabinet.

mode can be tag or section:

section mode will use planks, sections and sides to to control

the

lights. The websocket will return a plank-section-side combo when button pushed.
  • tag mode will use direct tags and controller numbers. The websocket will return a controller-tag combo when button pushed.

  • When the section call is done, and the

    cabinet

    is in mode tag (or the other way round), this will result in a HTTP409 Conflict

    .

    sides can be frontonly or frontandback:

    • frontonly is used when only the front controller is physically available. This suppresses any missing tags on the back, a missing connection of the back controller and will generate a HTTP404 when trying to write to a back tag, or to controller 2 when in tag mode.

    • frontandback should be used if two controllers are connected, which is only valid for the PTLCabinet.

    name is the name of the cabinet, this will be shown on the screen, scaled to fit, when the PTLControl is idle.

    When name is an HTML snippet surrounded by <div>the HTML will be rendered where the name is, centered on screen. The client is responsible for styling, scaling and layout.

    Request

    Code Block
    languagejson
    { 
      "planks": «numberofplanks», 
      "sections": «numberofsections»,
      "name": «nameofcabinet»,
      "
    mode
    sides": "
    section
    frontonly|
    tag
    frontandback",
      "
    sides
    demo": "
    frontonly|frontandback" }

    Response

    HTTP204 when successful

    Possible Errors

    HTTP400 when request was invalid

    Code Block
    languagejson
    {
    random-pick|barcode|off",
      "
    message
    tagmode": 
    «human readable error»
    "pick|zeropick|confirm|info|locked"
    }

    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" }

    tagmodes:

    • pick: (default) Tag can be used for picking, confirm button will send a WebSocket confirm message and amount can be adjusted down.

    • zeropick: Tag can be used for picking, confirm button will send a WebSocket confirm message. Button down will send a confirm message with amount 0.

    • confirm: Tag can be used for picking, confirm button will send aWebSocket confirm message. No adjustments can be made.

    • info: Tag is used for info. Buttons will send WebSocket messages, but tag will not turn off when confirm is pushed.

    • locked: Tag is read-only. Buttons have no effect, no messages are sent.

    Response

    HTTP204 when successful

    Possible Errors

    HTTP400 when request was invalid

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

    Remarks

    StatuscolourGreentitleimplemented

    v2.0

    • modewas removed

    v2.1

    • HTML support for name added

    • tagmode added

    URL

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

    teach

    lighttest

    Method

    PUT

    Description

    Sets the cabinet

    in or out of teach mode

    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
    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

    StatuscolourRedtitlenot in prototype