/api/customers/K0002/targets/group-services
with application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "New Group Service"
}, {
"name": "extensionNumber",
"value": "345"
}]
}
Then I should receive HTTP/1.1 201 Created
with http://localhost:9998/api/customers/K0002/targets/group-services/0 /api/customers/K0002/targets/group-services
with application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "New Group Service"
}, {
"name": "extensionNumber",
"value": "345"
}, {
"name": "pickUpGroup",
"value": true
}]
}
Then I should receive HTTP/1.1 201 Created
/api/customers/K0002/targets/group-services/0{
"data": [{
"name": "pickUpGroup",
"value": true
}]
}
/api/customers/K0002/targets/group-services
with application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": ""
}]
}
Then I should receive HTTP/1.1 400 Bad Request
and application/api-problem+json
with following body:
{
"errors": [{
"message": "Display name is missing",
"path": "displayName"
}]
}
/api/customers/K0002/targets/group-services
with application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "invalid?name"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
and application/api-problem+json
with following body:
{
"errors": [{
"message": "Display name should not contain these characters: & $ ! ? = | \" { }",
"path": "displayName",
"value": "invalid?name"
}]
}
/api/customers/K0002/targets/group-services
with application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "way, way, way, way, way, way, way, way, way too long name"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
and application/api-problem+json
with following body:
{
"errors": [{
"message": "Display name should have a length between 1 and 50 characters",
"path": "displayName",
"value": "way, way, way, way, way, way, way, way, way too long name"
}]
}
/api/customers/K0002/targets/group-services
with application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "New Group Service"
}, {
"name": "extensionNumber",
"value": "0345"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
and application/api-problem+json
with following body:
{
"errors": [{
"message": "Invalid extension number format. Must not start with the dial-out-prefix (default 0)",
"path": "extensionNumber",
"value": "0345"
}]
}
/api/customers/K0002/targets/group-services
with application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "New Group Service"
}, {
"name": "extensionNumber",
"value": "12345678909876543212345"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
and application/api-problem+json
with following body:
{
"errors": [{
"message": "Extension number length should not exceed 20 characters",
"path": "extensionNumber",
"value": "12345678909876543212345"
}]
}
/api/customers/K0002/targets/group-services
with application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "New Group Service"
}, {
"name": "extensionNumber",
"value": "123"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
and application/api-problem+json
with following body:
{
"errors": [{
"message": "Extension number is not unique.",
"path": "extensionNumber",
"value": "123"
}]
}
/api/customers/K0404/targets/group-services
with application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "New Group Service"
}, {
"name": "extensionNumber",
"value": "123"
}]
}
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/targets/group-services
with application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "New Group Service"
}, {
"name": "extensionNumber",
"value": "123"
}]
}
Then I should receive HTTP/1.1 403 Forbidden{
"title": "Access forbidden",
"detail": "Access denied to [Customer] with id [K0002]",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}
/api/customers/K0003/targets/group-services
with application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "New Group Service"
}, {
"name": "extensionNumber",
"value": "123"
}]
}
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/group-services
with application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "New Group Service"
}, {
"name": "extensionNumber",
"value": "123"
}]
}
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"
}