/api/customers/K0002/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {
"links": [{
"rel": "dropExtension",
"href": "/api/customers/K0002/targets/phone-extensions/159"
}, {
"rel": "timezone",
"href": "/api/time-zones/Europe.Berlin"
}],
"data": [{
"name": "trunkNumber",
"value": 5
}]
}
Then I should receive HTTP/1.1 204 No Content
/api/customers/K0002/trunks/0048.22.123456.0-20 HTTP/1.1 200 OK {
"links": [{
"rel": "dropExtension",
"href": "/api/customers/K0002/targets/phone-extensions/159"
}, {
"rel": "timezone",
"href": "/api/time-zones/Europe.Berlin"
}],
"data": [{
"name": "trunkNumber",
"value": "005"
}]
}
/api/customers/K0002/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {
"links": [{
"rel": "dropExtension",
"href": "/api/customers/K0002/targets/BUSY"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
with body
{
"detail": "Could not create or update resource due to constraint violations",
"title": "Validation error",
"errors": [{
"message": "Destination type should be one of: [CONFERENCE, EFAX, FRONTDESK, GROUP, IVR, NOOP, PHONEEXTENSION, QUEUE, ROUTINGPREFIX, SKILL, TIMECONTROL, VOICEMAIL]",
"path": "dropExtension",
"value": "BUSY"
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0002/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {
"links": [{
"rel": "dropExtension",
"href": "/api/customers/K0002/targets/phone-extensions/159"
}, {
"rel": "timezone",
"href": "/api/time-zones/Europe.Berlin"
}],
"data": [{
"name": "trunkNumber",
"value": 5
}]
}
Then I should receive HTTP/1.1 400 Bad Request
with body
{
"errors": [{
"message": "Trunk update is not allowed due to the inactive customer subcontract.",
"value": null
}]
}
/api/customers/K0002/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {
"links": [{
"rel": "dropExtension",
"href": "/api/customers/K0002/targets/NO_ACTION"
}]
}
Then I should receive HTTP/1.1 204 No Content
/api/customers/K0002/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {
"links": [{
"rel": "dropExtension",
"href": null
}]
}
Then I should receive HTTP/1.1 204 No Content
/api/customers/K0002/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {
"links": [{
"rel": "dropExtension",
"href": "/api/customers/K0003/targets/phone-extensions/159"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
with body
{
"errors": [{
"message": "Destination must belong to Customer [K0002]",
"path": "dropExtension",
"value": "/api/customers/K0003/targets/phone-extensions/159"
}]
}
/api/customers/K0002/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {
"links": [{
"rel": "inboundBlacklistGlobalProfile",
"href": "/api/customers/K0002/blacklist-global-profiles/Test_Blacklist_Global_Profile"
}]
}
Then I should receive HTTP/1.1 204 No Content
/api/customers/K0002/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {
"links": [{
"rel": "outboundBlacklistGlobalProfile",
"href": "/api/customers/K0002/blacklist-global-profiles/Test_Blacklist_Global_Profile"
}]
}
Then I should receive HTTP/1.1 204 No Content
/api/customers/K0002/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {
"data": [{
"name": "trunkNumber",
"value": 2
}, {
"name": "clipNoScreeningEnabled",
"value": false
}]
}
Then I should receive HTTP/1.1 204 No Content /api/customers/K0002/trunks/0048.22.123456.00-20 HTTP/1.1 200 OK {
"data": [{
"name": "trunkNumber",
"value": "002"
}, {
"name": "clipNoScreeningEnabled",
"value": false
}]
}
/api/customers/K0002/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {
"links": [{
"rel": "customerContract",
"href": "/api/customers/K0002/contracts/800D0000003ARnKIAW"
}, {
"rel": "softswitch",
"href": "/api/operators/C0002/softswitches/200"
}]
}
Then I should receive HTTP/1.1 204 No Content /api/customers/K0002/trunks/0048.22.123456.00-20 HTTP/1.1 200 OK {
"links": [{
"rel": "customerContract",
"href": "/api/customers/K0002/contracts/800D0000003ARnKIAW"
}, {
"rel": "softswitch",
"href": "/api/operators/C0002/softswitches/200"
}]
}
/api/customers/K0002/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {
"data": [{
"name": "salesForceId",
"value": "a0b20000000ABBB"
}, {
"name": "hairpinCallsEnabled",
"value": false
}]
}
Then I should receive HTTP/1.1 204 No Content /api/customers/K0002/trunks/0048.22.123456.00-20 HTTP/1.1 200 OK {
"data": [{
"name": "salesForceId",
"value": "a0b20000000ABBB"
}, {
"name": "hairpinCallsEnabled",
"value": false
}]
}
/api/customers/K0002/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {
"data": [{
"name": "salesForceId",
"value": "a0b20000000ABBB"
}, {
"name": "hairpinCallsEnabled",
"value": false
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Invalid field.",
"path": "salesForceId"
}, {
"message": "Invalid field.",
"path": "hairpinCallsEnabled"
}]
}
/api/customers/K0002/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {
"data": [{
"name": "trunkNumber",
"value": -1
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "trunkNumber must be positive integer",
"path": "trunkNumber",
"value": -1
}]
}
/api/customers/K0002/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {
"data": [{
"name": "trunkNumber",
"value": 333
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Only numbers with 2 digit(s) are allowed for trunkNumber",
"path": "trunkNumber",
"value": 333
}]
}
/api/customers/K0002/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {
"data": [{
"name": "trunkNumber",
"value": 2
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "trunkNumber 2 is already used",
"path": "trunkNumber",
"value": 2
}]
}
/api/customers/K0002/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {
"data": [{
"name": "salesForceId",
"value": "a0b20000000ACCC"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "salesForceId [a0b20000000ACCC] is already used by another Trunk",
"path": "salesForceId",
"value": "a0b20000000ACCC"
}]
}
/api/customers/K0002/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {
"links": [{
"rel": "customerContract",
"href": "/api/customers/K0003/contracts/800D0000003ARnKIAW"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Customer Contract [800D0000003ARnKIAW] does not belong to Customer [K0002]",
"path": "customerContract",
"value": "/api/customers/K0003/contracts/800D0000003ARnKIAW"
}]
}
/api/customers/K0002/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {
"links": [{
"rel": "softswitch",
"href": "/api/operators/C0003/softswitches/200"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Softswitch [200] does not belong to Operator [C0002]",
"path": "softswitch",
"value": "/api/operators/C0003/softswitches/200"
}]
}
/api/customers/K0002/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {
"data": [{
"name": "hairpinCallsEnabled",
"value": false
}, {
"name": "salesForceId",
"value": "a0b20000000ABBB"
}, {
"name": "clipNoScreeningEnabled",
"value": false
}],
"links": [{
"rel": "customerContract",
"href": "/api/customers/K0002/contracts/800D0000003ARnKIAW"
}, {
"rel": "softswitch",
"href": "/api/operators/C0002/softswitches/200"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
{
"errors": [{
"message": "Invalid field.",
"path": "clipNoScreeningEnabled"
}, {
"message": "Invalid field.",
"path": "hairpinCallsEnabled"
}, {
"message": "Invalid field.",
"path": "salesForceId"
}, {
"message": "Invalid field.",
"path": "customerContract"
}, {
"message": "Invalid field.",
"path": "softswitch"
}]
}
/api/customers/K0002/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {}
Then I should receive HTTP/1.1 404 Not Found application/api-problem+json {
"title": "Trunk not found",
"detail": "Trunk with number 0048.22.123456.0-20 has not been found",
"described_by": "http://api.nfon.net/probs/trunk-not-found"
}
/api/customers/K0404/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {}
Then I should receive HTTP/1.1 404 Not Found application/api-problem+json {
"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/K0003/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {}
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/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {}
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/trunks/0048.22.123456.0-20 application/json; charset=UTF-8 {}
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"
}