/api/customers/K0002/phone-books/100 application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "New Phone Book"
}, {
"name": "displayNumber",
"value": "+49 (66) 1234-888"
}]
}
Then I should receive HTTP/1.1 204 No Content /api/customers/K0002/phone-books/100 HTTP/1.1 200 OK {
"href": "/api/customers/K0002/phone-books/100",
"data": [{
"name": "displayName",
"value": "New Phone Book"
}, {
"name": "displayNumber",
"value": "+49 (66) 1234-888"
}]
}
/api/customers/K0002/phone-books/100 application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": ""
}, {
"name": "displayNumber",
"value": null
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "field is required",
"path": "displayName",
"value": ""
}, {
"message": "field is required",
"path": "displayNumber",
"value": null
}]
}
/api/customers/K0002/phone-books/100 application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "invalid=name"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "displayName contains invalid characters",
"path": "displayName",
"value": "invalid=name"
}]
}
/api/customers/K0002/phone-books/100 application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "very long, long, long, long, long, long, long, long name"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "displayName must have length between 1 and 50",
"path": "displayName",
"value": "very long, long, long, long, long, long, long, long name"
}]
}
/api/customers/K0002/phone-books/100 application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayNumber",
"value": "(66) 1234-555"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "displayNumber has invalid format",
"path": "displayNumber",
"value": "(66) 1234-555"
}]
}
/api/customers/K0002/phone-books/404 application/json; charset=UTF-8
and following body:
{}
Then I should receive HTTP/1.1 404 Not Found {
"detail": "Phone Book with ID 404 has not been found",
"title": "Phone Book not found",
"described_by": "http://api.nfon.net/probs/phone-book-not-found"
}
/api/customers/K0404/phone-books/100 application/json; charset=UTF-8
and following body:
{}
Then I should receive HTTP/1.1 404 Not Found {
"detail": "Customer with identifier K0404 has not been found",
"title": "Customer not found",
"described_by": "http://api.nfon.net/probs/customer-not-found"
}
/api/customers/K0002/phone-books/100 application/json; charset=UTF-8
and following body:
{}
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/phone-books/100 application/json; charset=UTF-8
and following body:
{}
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/phone-books/100 application/json; charset=UTF-8
and following body:
{}
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"
}