/api/customers/K0002/devices/operator-panel
using application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/nreception"
}],
"data": [{
"name": "macAddress",
"value": "01-23-45-67-89-ab"
}]
}
HTTP/1.1 201 Created
with
http://localhost:9998/api/customers/K0002/devices/operator-panel/01-23-45-67-89-ab
/api/customers/K0002/devices/operator-panel
using application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/nreception"
}],
"data": [{
"name": "macAddress",
"value": "01-23-45-67-89-ab"
}]
}
/api/customers/K0002/devices/operator-panel/01-23-45-67-89-ab should be populated with default values:
{
"links": [{
"rel": "firmware",
"href": "/api/customers/K0002/device-types/nreception/firmwares/1.0"
}],
"data": []
}
/api/customers/K0002/devices/operator-panel
using
application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/nreception"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/nreception/firmwares/150.123"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/54526563554535"
}],
"data": [{
"name": "macAddress",
"value": "01-23-45-67-89-ab"
}, {
"name": "license",
"value": "licenseKey"
}, {
"name": "suppressLineno",
"value": "DEFAULT"
}, {
"name": "note",
"value": "my personal note on post request"
}]
}
/api/customers/K0002/devices/operator-panel/01-23-45-67-89-ab
should return
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/nreception"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/nreception/firmwares/150.123"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/54526563554535"
}],
"data": [{
"name": "macAddress",
"value": "01-23-45-67-89-ab"
}, {
"name": "license",
"value": "licenseKey"
}, {
"name": "suppressLineno",
"value": "DEFAULT"
}, {
"name": "note",
"value": "my personal note on post request"
}]
}
/api/customers/K0002/devices/operator-panel
using
application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/nreception"
}],
"data": [{
"name": "macAddress",
"value": "01-23-45-67-89-ab"
}]
}
/api/customers/K0002/devices/operator-panel
using using
application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/nreception"
}],
"data": [{
"name": "macAddress",
"value": "01-23-45-67-89-ab"
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
{
"errors": [{
"message": "Mac Address '01-23-45-67-89-ab' is not unique",
"path": "macAddress"
}]
}
/api/customers/K0002/devices/operator-panel
using
application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/nreception"
}],
"data": [{
"name": "macAddress",
"value": "01-23-45-67-89-ab"
}, {
"name": "license",
"value": "123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 1"
}]
}
HTTP/1.1 400 Bad Request
{
"errors": [{
"message": "Length of provided license was 101, but allowed maximum is 100",
"path": "license"
}]
}
/api/customers/K0002/devices/operator-panel
using application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/nreception"
}],
"data": [{
"name": "macAddress",
"value": "01-23-45-67-89-ab"
}]
}
HTTP/1.1 201 Created
/api/customers/K0002/devices/operator-panel
using application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/nreception"
}],
"data": [{
"name": "macAddress",
"value": "01-23-45-67-89-ab"
}]
}
HTTP/1.1 403 Forbidden
/api/customers/K0002/devices/operator-panel
using application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/nreception"
}],
"data": [{
"name": "macAddress",
"value": "01-23-45-67-89-ab"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
"errors": [{
"message": "Customer contract type does not allow to add more Devices"
}]
}