/api/customers/K0002/targets/ivr-services
using
application/json; charset=UTF-8
{
"links": [{
"rel": "announcement",
"href": "/api/customers/K0002/announcements/13"
}],
"data": [{
"name": "displayName",
"value": "New IVR Service"
}, {
"name": "extensionNumber",
"value": "579"
}, {
"name": "interpretUnknownAsExtension",
"value": true
}, {
"name": "maxNumberOfDigits",
"value": 3
}]
}
HTTP/1.1 201 Created
{
"href": "/api/customers/K0002/targets/ivr-services/0"
}
/api/customers/K0002/targets/ivr-services/0
{
"links": [{
"rel": "announcement",
"href": "/api/customers/K0002/announcements/13"
}],
"data": [{
"name": "displayName",
"value": "New IVR Service"
}, {
"name": "extensionNumber",
"value": "579"
}, {
"name": "interpretUnknownAsExtension",
"value": true
}, {
"name": "maxNumberOfDigits",
"value": 3
}]
}
/api/customers/K0002/targets/ivr-services
application/json; charset=UTF-8
body
{
"data": [{
"name": "extensionNumber",
"value": "579"
}]
}
Then the response code should be equal
HTTP/1.1 400 Bad Request
{
"errors": [{
"message": "Display name is missing",
"path": "displayName"
}]
}
/api/customers/K0002/targets/ivr-services
application/json; charset=UTF-8
with following body
{
"data": [{
"name": "displayName",
"value": "invalid display=name"
}, {
"name": "extensionNumber",
"value": "579"
}]
}
HTTP/1.1 400 Bad Request
{
"errors": [{
"message": "Display name should not contain these characters: & $ ! ? = | \" { }",
"path": "displayName",
"value": "invalid display=name"
}]
}
/api/customers/K0002/targets/ivr-services
using
application/json; charset=UTF-8
{
"data": [{
"name": "displayName",
"value": "this is a way, way, way, way, way, way, way, way, way to long displayName"
}, {
"name": "extensionNumber",
"value": "579"
}]
}
HTTP/1.1 400 Bad Request
{
"errors": [{
"message": "Display name should have a length between 1 and 50 characters",
"path": "displayName",
"value": "this is a way, way, way, way, way, way, way, way, way to long displayName"
}]
}
/api/customers/K0002/targets/ivr-services
using
application/json; charset=UTF-8
{
"data": [{
"name": "displayName",
"value": "New IVR Service"
}]
}
Then the response code should be equal
HTTP/1.1 201 Created
{
"href": "/api/customers/K0002/targets/ivr-services/0"
}
/api/customers/K0002/targets/ivr-services/0
{
"data": [{
"name": "displayName",
"value": "New IVR Service"
}]
}
/api/customers/K0002/targets/ivr-services
using
application/json; charset=UTF-8
with following body
{
"data": [{
"name": "displayName",
"value": "New IVR Service"
}, {
"name": "extensionNumber",
"value": "0123"
}]
}
Then the response code should be equal
HTTP/1.1 400 Bad Request
And the response should look like:
{
"errors": [{
"message": "Invalid extension number format. Must not start with the dial-out-prefix (default 0)",
"path": "extensionNumber",
"value": "0123"
}]
}
/api/customers/K0002/targets/ivr-services
using
application/json; charset=UTF-8
with following body
{
"data": [{
"name": "displayName",
"value": "New IVR Service"
}, {
"name": "extensionNumber",
"value": "12345678901234567890123456789"
}]
}
Then the response code should be equal
HTTP/1.1 400 Bad Request
And the response should look like:
{
"errors": [{
"message": "Extension number length should not exceed 20 characters",
"path": "extensionNumber",
"value": "12345678901234567890123456789"
}]
}
/api/customers/K0002/targets/ivr-services
with following application/json; charset=UTF-8 body
{
"data": [{
"name": "displayName",
"value": "New IVR Service"
}, {
"name": "extensionNumber",
"value": "1234"
}]
}
Then the response code should be equal
HTTP/1.1 400 Bad Request
And the response should look like:
{
"errors": [{
"message": "Extension number is not unique.",
"path": "extensionNumber",
"value": "1234"
}]
}
/api/customers/K0002/targets/ivr-services
using
application/json; charset=UTF-8
with following body
{
"links": [{
"rel": "announcement",
"href": "/api/customers/K0002/announcements/131"
}],
"data": [{
"name": "displayName",
"value": "someDisplayName"
}, {
"name": "extensionNumber",
"value": "579"
}]
}
Then the response code should be equal
HTTP/1.1 400 Bad Request
And the response should look like:
{
"errors": [{
"message": "Expected announcement to be type of [GENERAL_ANNOUNCEMENT] but was [MUSIC_ON_HOLD]",
"path": "announcement"
}]
}
/api/customers/K404/targets/ivr-services
using
application/json; charset=UTF-8
{}
HTTP/1.1 404 Not Found
{
"title": "Customer not found",
"detail": "Customer with identifier K404 has not been found",
"described_by": "http://api.nfon.net/probs/customer-not-found"
}
/api/customers/K0003/targets/ivr-services
using
application/json; charset=UTF-8
{}
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/ivr-services as 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/targets/ivr-services as 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"
}