/api/customers/K0002/devices/base/ABCDEF012345/handsets as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "port",
"value": "Port0"
}, {
"name": "bluetoothPin",
"value": "8264"
}, {
"name": "suppressLineno",
"value": "DEFAULT"
}, {
"name": "note",
"value": "my personal note on post request"
}]
}
Then I should receive HTTP/1.1 201 Created
with following body:
{
"href": "/api/customers/K0002/devices/base/ABCDEF012345/handsets/Port0"
}
And Handset Port0 is connected with Base ABCDEF012345
/api/customers/K0002/devices/base/ABCDEF012345/handsets/Port0 should return:
{
"data": [{
"name": "port",
"value": "Port0"
}, {
"name": "bluetoothPin",
"value": "8264"
}, {
"name": "suppressLineno",
"value": "DEFAULT"
}, {
"name": "note",
"value": "my personal note on post request"
}]
}
/api/customers/K0002/devices/base/ABCDEF012345/handsets as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "port",
"value": "Port0"
}, {
"name": "bluetoothPin",
"value": "8264"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
"title": "Device option not supported",
"detail": "Device option BLUETOOTH_PIN is not supported by device type Handset Device Type",
"described_by": "http://api.nfon.net/probs/device-option-not-supported"
}
/api/customers/K0002/devices/base/ABCDEF012345/handsets as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "port",
"value": "Port0"
}, {
"name": "bluetoothPin",
"value": "12345"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
"title": "bluetoothPin is invalid",
"detail": "bluetoothPin should contain 4 digits, but 12345 was provided",
"described_by": "http://api.nfon.net/probs/invalid-bluetooth-pin"
}
/api/customers/K0002/devices/base/ABCDEF012345/handsets as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "port",
"value": "Port0"
}]
}
Then I should receive HTTP/1.1 400 Bad Request with following body:
{
"described_by": "http://api.nfon.net/probs/no-handset-type",
"title": "No matching Handset Type for given Base",
"detail": "There is no matching Handset type for Base Type [Base Device]"
}
/api/customers/K0002/devices/base/ABCDEF012345/handsets as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "port",
"value": "Port0"
}]
}
Then I should receive HTTP/1.1 400 Bad Request with following body:
{
"described_by": "http://api.nfon.net/probs/invalid-ipei-number",
"title": "IPEI number is invalid",
"detail": "IPEI number should contain 12 digits, but Port0 was provided"
}
/api/customers/K0002/devices/base/ABCDEF012396/handsets as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "port",
"value": "Port0"
}]
}
Then I should receive HTTP/1.1 400 Bad Request with following body:
{
"detail": "IPUI has to be a 10 characters long hex value but Port0 was provided",
"title": "IPUI number is invalid",
"described_by": "http://api.nfon.net/probs/invalid-ipui-number"
}
/api/customers/K0002/devices/base/ABCDEF012345/handsets as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "port",
"value": "012345678912"
}]
}
Then I should receive HTTP/1.1 400 Bad Request with following body:
{
"described_by": "http://api.nfon.net/probs/device-id-not-unique",
"title": "Device Id is not unique",
"detail": "There is already a device with id ABCDEF012345-012345678912"
}
/api/customers/K0002/devices/base/ABCDEF012397/handsets as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "port",
"value": "00ABC50871"
}]
}
Then I should receive HTTP/1.1 400 Bad Request with following body:
{
"detail": "There is already a device with id ABCDEF012397-00ABC50871",
"title": "Device Id is not unique",
"described_by": "http://api.nfon.net/probs/device-id-not-unique"
}
/api/customers/K0002/devices/base/ABCDEF012345/handsets as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "port",
"value": "Port123"
}]
}
Then I should receive HTTP/1.1 400 Bad Request with following body:
{
"described_by": "http://api.nfon.net/probs/port-not-available",
"title": "Port is not available",
"detail": "Port ABCDEF012345-Port123 is not available for this base device"
}
/api/customers/K0003/devices/base/ABCDEF012345/handsets as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "port",
"value": "Port0"
}, {
"name": "bluetoothPin",
"value": "8264"
}]
}
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"
}]
}
/api/customers/K0404/devices/base/ABCDEF012345/handsets
as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "port",
"value": "Port0"
}, {
"name": "bluetoothPin",
"value": "8264"
}]
}
Then I should receive HTTP/1.1 404 Not Found {
"described_by": "http://api.nfon.net/probs/customer-not-found",
"title": "Customer not found",
"detail": "Customer with identifier K0404 has not been found"
}
/api/customers/K0002/devices/base/ABCDEF012345/handsets as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "port",
"value": "Port0"
}, {
"name": "bluetoothPin",
"value": "8264"
}]
}
Then I should receive HTTP/1.1 403 Forbidden
with following body:
{
"title": "Access forbidden",
"detail": "Access denied to [Customer] with id [K0002]",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}
/api/customers/K0003/devices/base/ABCDEF012345/handsets
as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "port",
"value": "Port0"
}, {
"name": "bluetoothPin",
"value": "8264"
}]
}
Then I should receive HTTP/1.1 403 Forbidden {
"title": "Access forbidden",
"detail": "Access denied to [Customer] with id [K0003]",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}
/api/customers/K0003/devices/base/ABCDEF012345/handsets
as application/json; charset=UTF-8
with following body:
{
"data": [{
"name": "port",
"value": "Port0"
}, {
"name": "bluetoothPin",
"value": "8264"
}]
}
Then I should receive HTTP/1.1 403 Forbidden {
"title": "Access forbidden",
"detail": "Access denied to [Customer] with id [K0003]",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}