suppressLineNo possible values are: DEFAULT(use the trunk setting), ON, OFF
When I send/api/customers/K0002/devices/xcapi with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/XCAPI"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "device123"
}, {
"name": "concurrentLines",
"value": 15
}, {
"name": "suppressLineno",
"value": "DEFAULT"
}, {
"name": "setE164DidInTo",
"value": false
}, {
"name": "cidScreening",
"value": "ALLOW_ANY"
}]
}
Then I should receive HTTP/1.1 201 Created
with http://localhost:9998/api/customers/K0002/devices/xcapi/device123 {
"href": "/api/customers/K0002/devices/xcapi/device123"
}
/api/customers/K0002/devices/xcapi/device123 HTTP/1.1 200 OK {
"href": "/api/customers/K0002/devices/xcapi/device123",
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/XCAPI"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}, {
"rel": "customer",
"href": "/api/customers/K0002"
}, {
"rel": "activation",
"href": "/api/customers/K0002/devices/xcapi/device123/activate"
}, {
"rel": "siteOptions",
"href": "/api/customers/K0002/devices/xcapi/device123/site-options"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "device123"
}, {
"name": "concurrentLines",
"value": 15
}, {
"name": "suppressLineno",
"value": "DEFAULT"
}, {
"name": "setE164DidInTo",
"value": false
}, {
"name": "cidScreening",
"value": "ALLOW_ANY"
}]
}
/api/customers/K0002/devices/xcapi with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/XCAPI"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "device123"
}]
}
Then I should receive HTTP/1.1 201 Created
/api/customers/K0002/devices/xcapi/device123 HTTP/1.1 200 OK {
"href": "/api/customers/K0002/devices/xcapi/device123",
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/XCAPI"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/1"
}, {
"rel": "customer",
"href": "/api/customers/K0002"
}, {
"rel": "activation",
"href": "/api/customers/K0002/devices/xcapi/device123/activate"
}, {
"rel": "siteOptions",
"href": "/api/customers/K0002/devices/xcapi/device123/site-options"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "device123"
}, {
"name": "concurrentLines",
"value": 100
}, {
"name": "suppressLineno",
"value": "DEFAULT"
}, {
"name": "active",
"value": true
}, {
"name": "useSiteOptionsFromSite",
"value": true
}]
}
/api/customers/K0002/devices/xcapi
with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/XCAPI"
}, {
"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/K0002/devices/xcapi with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/XCAPI"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "device123"
}, {
"name": "concurrentLines",
"value": 1410
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Invalid value for concurrentLines",
"detailMessage": "concurrentLines value should be between 1 and 999",
"path": "concurrentLines"
}]
}
/api/customers/K0002/devices/xcapi/device123 HTTP/1.1 404 Not Found /api/customers/K0003/devices/xcapi with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0003/device-types/XCAPI"
}, {
"rel": "site",
"href": "/api/customers/K0003/sites/anotherSite"
}],
"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/xcapi
with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/XCAPI"
}, {
"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/xcapi with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/XCAPI"
}, {
"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/xcapi
with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/XCAPI"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}],
"data": [{
"name": "uniqueIdentifier",
"value": ""
}]
}
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": "Bean Validation constraint(s) violated while executing Automatic Bean Validation on callback event:'prePersist'. Please refer to embedded ConstraintViolations for details.",
"value": null
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0002/devices/xcapi
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 {
"detail": "Could not create or update resource due to constraint violations",
"title": "Validation error",
"errors": [{
"message": "Cannot create XCAPI Device with type that is not XCAPI category",
"path": "deviceType",
"value": "/api/customers/K0002/device-types/unprovisioned_sip"
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0002/devices/xcapi
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/xcapi
with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/XCAPI"
}, {
"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/xcapi
with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/XCAPI"
}, {
"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/xcapi with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/XCAPI"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/a062000000HbAsd"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "device123"
}, {
"name": "concurrentLines",
"value": 15
}, {
"name": "suppressLineno",
"value": "DEFAULT"
}]
}
Then I should get HTTP/1.1 403 Forbidden {
"detail": "Access denied to [DeviceType] with id [XCAPI]",
"title": "Access forbidden",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}