/api/customers/K0002/targets/phone-extensions/201/devicesapplication/json; charset=UTF-8 {
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/standard/ABCDEF012345"
}]
}
Then response code should be equal HTTP/1.1 201 Created http://localhost:9998/api/customers/K0002/targets/phone-extensions/201/devices/api/customers/K0002/targets/phone-extensions/201/devices HTTP/1.1 200 OK
with following body:
{
"items": [{
"href": "/api/customers/K0002/devices/standard/ABCDEF012345",
"links": [{
"rel": "deletion",
"href": "/api/customers/K0002/targets/phone-extensions/201/devices/ABCDEF012345"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "ABCDEF012345"
}, {
"name": "masterCategory",
"value": "STANDARD"
}, {
"name": "deviceType",
"value": "standard"
}, {
"name": "category",
"value": "category"
}]
}]
}
/api/customers/K0002/targets/phone-extensions/201/devicesapplication/json; charset=UTF-8 {
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/standard/ABCDEF012345"
}]
}
Then response code should be equal HTTP/1.1 201 Created /api/customers/K0002/targets/phone-extensions/201 HTTP/1.1 200 OK
with following body:
{
"href": "/api/customers/K0002/targets/phone-extensions/201",
"links": [{
"rel": "primaryDevice",
"href": "/api/customers/K0002/devices/standard/ABCDEF012345"
}]
}
/api/customers/K0002/targets/phone-extensions/201/devicesapplication/json; charset=UTF-8 {
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/base/ABCDEF012345"
}]
}
Then response code should be equal HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Cannot attach Base device.",
"value": "ABCDEF012345",
"path": "deviceToAttach"
}]
}
/api/customers/K0002/targets/phone-extensions/201/devicesapplication/json; charset=UTF-8 {
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/base/ABCDEF012345"
}]
}
Then response code should be equal HTTP/1.1 201 Created /api/customers/K0002/targets/phone-extensions/201/devicesapplication/json; charset=UTF-8 {
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/standard/ABCDEF012345"
}]
}
Then response code should be equal HTTP/1.1 201 Created /api/customers/K0002/targets/phone-extensions/202/devicesapplication/json; charset=UTF-8 {
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/standard/ABCDEF012345"
}]
}
Then response code should be equal HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Device ABCDEF012345 is already attached to Phone Extension 201",
"value": "ABCDEF012345",
"path": "deviceToAttach"
}]
}
/api/customers/K0002/targets/phone-extensions/201/devicesapplication/json; charset=UTF-8 {
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/standard/ABCDEF012345"
}]
}
Then response code should be equal HTTP/1.1 201 Created /api/customers/K0002/targets/phone-extensions/201/devicesapplication/json; charset=UTF-8 {
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/standard/ABCDEF012345"
}]
}
Then response code should be equal HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Device ABCDEF012345 is already attached to Phone Extension 201",
"value": "ABCDEF012345",
"path": "deviceToAttach"
}]
}
/api/customers/K0002/targets/phone-extensions/201/devicesapplication/json; charset=UTF-8 {
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/xcapi/ABCDEF012345"
}]
}
Then response code should be equal HTTP/1.1 201 Created /api/customers/K0002/targets/phone-extensions/201/devices HTTP/1.1 200 OK
with following body:
{
"items": [{
"href": "/api/customers/K0002/devices/xcapi/ABCDEF012345"
}]
}
/api/customers/K0002/targets/phone-extensions/202/devicesapplication/json; charset=UTF-8 {
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/xcapi/ABCDEF012345"
}]
}
Then response code should be equal HTTP/1.1 201 Created /api/customers/K0002/targets/phone-extensions/202/devices HTTP/1.1 200 OK
with following body:
{
"items": [{
"href": "/api/customers/K0002/devices/xcapi/ABCDEF012345"
}]
}
/api/customers/K0002/targets/phone-extensions/201/devicesapplication/json; charset=UTF-8 {
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/standard/ABCDEF012345"
}]
}
Then response code should be equal HTTP/1.1 201 Created /api/customers/K0002/targets/phone-extensions/201/devicesapplication/json; charset=UTF-8 {
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/xcapi/ABCDEF678901"
}]
}
Then response code should be equal HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Phone extension with Xcapi attached cannot have any other devices attached! If you wish to attach Xcapi device, deattach all other devices first."
}]
}
/api/customers/K0002/targets/phone-extensions/201/devicesapplication/json; charset=UTF-8 {
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/xcapi/ABCDEF678901"
}]
}
Then response code should be equal HTTP/1.1 201 Created /api/customers/K0002/targets/phone-extensions/201/devicesapplication/json; charset=UTF-8 {
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/standard/ABCDEF012345"
}]
}
Then response code should be equal HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Phone extension with Xcapi attached cannot have any other devices attached! If you wish to attach this device, deattach the Xcapi device first."
}]
}
/api/customers/K0002/targets/phone-extensions/201/devicesapplication/json; charset=UTF-8 {
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/standard/ABCDEF012345"
}]
}
Then response code should be equal HTTP/1.1 201 Created /api/customers/K0002/targets/phone-extensions/201/devicesapplication/json; charset=UTF-8 {
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/unprovisioned-sip/ABCDEF678901"
}]
}
Then response code should be equal HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Phone extension with DAKS attached cannot have any other devices attached! If you wish to attach DAKS device, deattach all other devices first."
}]
}
/api/customers/K0002/targets/phone-extensions/201/devicesapplication/json; charset=UTF-8 {
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/unprovisioned-sip/ABCDEF678901"
}]
}
Then response code should be equal HTTP/1.1 201 Created /api/customers/K0002/targets/phone-extensions/201/devicesapplication/json; charset=UTF-8 {
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/standard/ABCDEF012345"
}]
}
Then response code should be equal HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Phone extension with DAKS attached cannot have any other devices attached! If you wish to attach this device, deattach the DAKS device first."
}]
}
/api/customers/K0002/targets/phone-extensions/201/devices application/json; charset=UTF-8 {
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0003/devices/standard/ABCDEF012345"
}]
}
Then response code should be equal HTTP/1.1 403 Forbidden application/api-problem+json {
"title": "Access forbidden",
"detail": "Access denied to [Customer] with id [K0003]",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}
/api/customers/K0002/targets/phone-extensions/201/devices application/json; charset=UTF-8 {
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0003/devices/standard/ABCDEF012345"
}]
}
Then response code should be equal HTTP/1.1 400 Bad Request application/api-problem+json {
"errors": [{
"message": "Device is invalid for selected Phone Extension",
"detailMessage": "Provided device ABCDEF012345 is invalid for Phone Extension 201",
"path": "deviceToAttach"
}]
}
/api/customers/K0404/targets/phone-extensions/1/devices
As application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/standard/ABCDEF012345"
}]
}
Then response code should be equal HTTP/1.1 404 Not Found application/api-problem+json {
"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/targets/phone-extensions/404/devices
As application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/standard/ABCDEF012345"
}]
}
Then response code should be equal HTTP/1.1 404 Not Found application/api-problem+json {
"title": "Extension not found",
"detail": "Extension with extension number 404 has not been found",
"described_by": "http://api.nfon.net/probs/extension-not-found"
}
/api/customers/K0002/targets/phone-extensions/201/devices
As application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0002/devices/standard/ABCDEF000404"
}]
}
Then response code should be equal HTTP/1.1 404 Not Found application/api-problem+json {
"title": "Device not found",
"detail": "Device with unique identifier ABCDEF000404 has not been found",
"described_by": "http://api.nfon.net/probs/device-not-found"
}
/api/customers/K0003/targets/phone-extensions/201/devices
As application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0003/devices/standard/ABCDEF000404"
}]
}
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/targets/phone-extensions/201/devices
As application/json; charset=UTF-8
with following body:
{
"links": [{
"rel": "deviceToAttach",
"href": "/api/customers/K0003/devices/standard/ABCDEF000404"
}]
}
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"
}