/api/customers/K0002/devices/unprovisioned-sip with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/unprovisioned_sip"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "device123"
}]
}
Then I should receive HTTP/1.1 201 Created
with http://localhost:9998/api/customers/K0002/devices/unprovisioned-sip/device123 {
"href": "/api/customers/K0002/devices/unprovisioned-sip/device123"
}
/api/customers/K0002/devices/unprovisioned-sip/device123 HTTP/1.1 200 OK {
"href": "/api/customers/K0002/devices/unprovisioned-sip/device123",
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/unprovisioned_sip"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "device123"
}]
}
/api/customers/K0002/devices/unprovisioned-sip with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/unprovisioned_sip"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "device123"
}]
}
Then I should receive HTTP/1.1 201 Created
/api/customers/K0002/devices/unprovisioned-sip/device123 HTTP/1.1 200 OK {
"href": "/api/customers/K0002/devices/unprovisioned-sip/device123",
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/unprovisioned_sip"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/1"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "device123"
}]
}
/api/customers/K0002/devices/unprovisioned-sip with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/unprovisioned_sip"
}, {
"rel": "site",
"href": "/api/customers/K0003/sites/anotherSite"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "device123"
}]
}
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": "Site not allowed",
"detailMessage": "Site [anotherSite] is not reachable for customer [K0002]",
"path": "site",
"value": null
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0003/devices/unprovisioned-sip
with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0003/device-types/unprovisioned_sip"
}, {
"rel": "site",
"href": "/api/customers/K0003/sites/a062000000HbAsd"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "device123"
}]
}
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/unprovisioned-sip with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/unprovisioned_sip"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "device123"
}]
}
Then I should receive HTTP/1.1 201 Created/api/customers/K0002/devices/unprovisioned-sip with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/unprovisioned_sip"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "device123"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Unique Identifier is not unique",
"path": "uniqueIdentifier",
"value": "device123"
}]
}
/api/customers/K0002/devices/unprovisioned-sip with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/unprovisioned_sip"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}]
}
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": "uniqueIdentifier must not be null or empty",
"path": "uniqueIdentifier",
"value": null
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0002/devices/unprovisioned-sip
with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/fmc"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "device123"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Cannot create Unprovisioned Sip Device with type that is not Unprovisioned Sip category",
"path": "deviceType",
"value": "/api/customers/K0002/device-types/fmc"
}]
}
/api/customers/K0002/devices/unprovisioned-sip
with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/not_existing"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "device123"
}]
}
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/unprovisioned-sip
with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/unprovisioned_sip"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/not-existing"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "device123"
}]
}
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/K0404/devices/unprovisioned-sip
with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/unprovisioned_sip"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "device123"
}]
}
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/unprovisioned-sip with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/unprovisioned_sip"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "device123"
}]
}
Then I should get HTTP/1.1 403 Forbidden {
"detail": "Access denied to [DeviceType] with id [unprovisioned_sip]",
"title": "Access forbidden",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}