These REST calls are used in the mapping feature, where a user can upload mapping info and use that info to switch on light.
URL | http://<<ip address>>/rest/mapping
|
---|
Method | GET |
---|
Description | Receive the current existing mapping. Returns an empty object when no mapping is set. |
---|
Response | Code Block |
---|
{
«barcode»: {
"plank": «plank»,
"section": «section»,
...
},
...
} |
|
---|
Status | Status |
---|
colour | Green |
---|
title | implemented |
---|
|
|
---|
URL | http://<<ip address>>/rest/mapping
|
---|
Method | POST |
---|
Description | Upload a new XLSX file to register a mapping. It will read the columns barcode , description (optional), plank and section from the first sheet. If the mandatory columns are not available, an HTTP400 error will occur. Column headers are expected on row 1, starting from column A. On upload, all existing data will be erased and the new data is loaded. |
---|
Request | Code Block |
---|
{
"exceldata": «base64 encoded xlsx file data»
} |
|
---|
Response | HTTP204 |
---|
is when successful |
Possible Errors | HTTP400 when request was invalid Code Block |
---|
{
"message": «human readable error»
} |
|
---|
Status | statuscolour | Green |
---|
title | implemented |
---|
|
URL | http://<<ip address>>/rest/mapping/«barcode»
|
---|
Method | PUT |
---|
Description | Set the light that corresponds to the barcode in the previously uploaded mapping. This behaves the same as the rest/plank/«plank»/section/«section»/side/front call. The cabinet needs to be in section mode for this to work correctly. |
---|
Request | Code Block |
---|
{
"value": «valuetodisplay»,
["color": "red|green|orange|blue|pink|cyan"]
} |
color is optional. When no color is chosen, it defaults to red .
|
---|
Response | HTTP204 when successful |
---|
Possible errors | HTTP400 when request was invalid Code Block |
---|
{
"message": «human readable error»
} |
HTTP404 with no body when mapping for barcode does not exist HTTP409 when |
---|
cabinet not in correct mode, or when the mapped resource was invalid (which can only be solved by a valid upload, see above).Status | Status |
---|
colour | Red |
---|
title | pending