/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 201 Created with http://localhost:9998/api/customers/K0002/devices/standard/123456789abc {
"href": "/api/customers/K0002/devices/standard/123456789abc"
}
/api/customers/K0002/devices/standard/123456789abc HTTP/1.1 200 OK {
"href": "/api/customers/K0002/devices/standard/123456789abc",
"links": [{
"rel": "customer",
"href": "/api/customers/K0002"
}, {
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/standard/firmwares/1.0"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/1"
}, {
"rel": "activation",
"href": "/api/customers/K0002/devices/standard/123456789abc/activate"
}, {
"rel": "siteOptions",
"href": "/api/customers/K0002/devices/standard/123456789abc/site-options"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}, {
"name": "ringtoneExternal",
"value": 1
}, {
"name": "ringtoneInternal",
"value": null
}, {
"name": "groupQueueSkillRingtone",
"value": null
}, {
"name": "active",
"value": true
}, {
"name": "useSiteOptionsFromSite",
"value": true
}, {
"name": "webguiHttpsonly",
"value": false
}]
}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/standard/firmwares/01.49"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}, {
"name": "ringtoneInternal",
"value": 5
}, {
"name": "ringtoneExternal",
"value": 4
}, {
"name": "groupQueueSkillRingtone",
"value": 4
}, {
"name": "webguiHttpsonly",
"value": true
}, {
"name": "suppressLineno",
"value": "DEFAULT"
}, {
"name": "note",
"value": "my personal note on post request"
}]
}
Then I should receive HTTP/1.1 201 Created with http://localhost:9998/api/customers/K0002/devices/standard/123456789abc {
"href": "/api/customers/K0002/devices/standard/123456789abc"
}
/api/customers/K0002/devices/standard/123456789abc HTTP/1.1 200 OK {
"href": "/api/customers/K0002/devices/standard/123456789abc",
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/standard/firmwares/01.49"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}, {
"name": "ringtoneInternal",
"value": 5
}, {
"name": "ringtoneExternal",
"value": 4
}, {
"name": "groupQueueSkillRingtone",
"value": 4
}, {
"name": "webguiHttpsonly",
"value": true
}, {
"name": "suppressLineno",
"value": "DEFAULT"
}, {
"name": "note",
"value": "my personal note on post request"
}]
}
/api/customers/K0003/devices/standard
with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0003/device-types/standard"
}, {
"rel": "site",
"href": "/api/customers/K0003/sites/a062000000HbAsd"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
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/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/standard/firmwares/01.49"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}, {
"name": "ringtoneExternal",
"value": 4
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Field not allowed for device type or selected firmware",
"path": "ringtoneExternal"
}]
}
/api/customers/K0002/devices/standard/123456789abc HTTP/1.1 404 Not Found /api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/standard/firmwares/01.49"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}, {
"name": "ringtoneInternal",
"value": 5
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Field not allowed for device type or selected firmware",
"path": "ringtoneInternal"
}]
}
/api/customers/K0002/devices/standard/123456789abc HTTP/1.1 404 Not Found /api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/standard/firmwares/01.49"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}, {
"name": "groupQueueSkillRingtone",
"value": 4
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"detail": "Could not create or update resource due to constraint violations",
"title": "Validation error",
"errors": [{
"message": "Field not allowed for device type or selected firmware",
"path": "groupQueueSkillRingtone",
"value": null
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0002/devices/standard/123456789abc HTTP/1.1 404 Not Found /api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/standard/firmwares/01.49"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}, {
"name": "ringtoneExternal",
"value": 55
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Invalid value for Ringtone. Allowed values are 0-5",
"path": "ringtoneExternal"
}]
}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/standard/firmwares/01.49"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}, {
"name": "ringtoneInternal",
"value": 55
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Invalid value for Ringtone. Allowed values are 0-5",
"path": "ringtoneInternal"
}]
}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/standard/firmwares/01.49"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}, {
"name": "groupQueueSkillRingtone",
"value": 55
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"detail": "Could not create or update resource due to constraint violations",
"title": "Validation error",
"errors": [{
"message": "Invalid value for Ringtone. Allowed values are 0-5",
"path": "groupQueueSkillRingtone",
"value": null
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 201 Created with http://localhost:9998/api/customers/K0002/devices/standard/123456789abc {
"href": "/api/customers/K0002/devices/standard/123456789abc"
}
/api/customers/K0002/devices/standard/123456789abc HTTP/1.1 200 OK {
"href": "/api/customers/K0002/devices/standard/123456789abc",
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/standard/firmwares/10.45"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "site",
"href": "/api/customers/K0003/sites/anotherSite"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 400 Bad Request{
"errors": [{
"message": "Site not allowed",
"detailMessage": "Site [anotherSite] is not reachable for customer [K0002]",
"path": "site"
}]
}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 201 Created/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "MAC number not unique",
"path": "uniqueIdentifier"
}]
}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}],
"data": [{
"name": "uniqueIdentifier",
"value": ""
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "MAC number not defined",
"path": "uniqueIdentifier"
}]
}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abcinvalid"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "MAC number not valid",
"path": "uniqueIdentifier"
}]
}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/standard/firmwares/01.34-beta"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 403 Forbidden {
"title": "Access forbidden",
"detail": "Access denied to [Firmware] with id [01.34-beta]",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/standard/firmwares/01.34-beta"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 403 Forbidden {
"title": "Access forbidden",
"detail": "Access denied to [Firmware] with id [01.34-beta]",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/standard/firmwares/01.34-beta"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 403 Forbidden {
"title": "Access forbidden",
"detail": "Access denied to [Firmware] with id [01.34-beta]",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/standard/firmwares/01.34-beta"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 201 Created {}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/standard/firmwares/01.34"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 201 Created {}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/standard/firmwares/01.34"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 201 Created {}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/standard/firmwares/01.34"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 201 Created {}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/standard/firmwares/01.34"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 201 Created {}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/otherStandard/firmwares/01.34-beta"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Firmware is invalid for selected device type",
"detailMessage": "Provided firmware with releaseVersion 01.34-beta is invalid for device with type standard",
"path": "firmware"
}]
}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "firmware",
"href": "/api/customers/K0002/device-types/standard/firmwares/01.23-missing"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 404 Not Found {
"title": "Firmware not found",
"detail": "Firmware with releaseVersion 01.23-missing not found",
"described_by": "http://api.nfon.net/probs/firmware-not-found"
}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/beta"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 403 Forbidden {
"title": "Access forbidden",
"detail": "Access denied to [DeviceType] with id [beta]",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/not-existing"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 404 Not Found {
"title": "Device Type not found",
"detail": "Device Type with name not-existing not found",
"described_by": "http://api.nfon.net/probs/device-type-not-found"
}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/base"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Cannot create Standard Device with type that is not Standard category",
"path": "deviceType",
"value": "/api/customers/K0002/device-types/base"
}]
}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/not-existing"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 404 Not Found {
"detail": "Site [not-existing] not found for Customer [K0002]",
"described_by": "http://api.nfon.net/probs/site-not-found"
}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "site",
"href": "/api/customers/K0003/sites/anotherSite"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
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/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}, {
"rel": "site",
"href": "/api/customers/K0003/sites/anotherSite"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Site not allowed",
"detailMessage": "Site [anotherSite] is not reachable for customer [K0002]",
"path": "site"
}]
}
/api/customers/K0404/devices/standard
with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 404 Not Found {
"title": "Customer not found",
"detail": "Customer with identifier K0404 has not been found",
"described_by": "http://api.nfon.net/probs/customer-not-found"
}
/api/customers/K0002/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/standard"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should get HTTP/1.1 403 Forbidden {
"title": "Access forbidden",
"detail": "Access denied to [Customer] with id [K0002]",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}
/api/customers/K0003/devices/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0003/device-types/standard"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
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/standard with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0003/device-types/standard"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
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"
}