/api/customers/K0002/phone-books application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "Phone Book"
}, {
"name": "displayNumber",
"value": "+49 (66) 1234-555"
}]
}
Then I should receive HTTP/1.1 201 Created http://localhost:9998/api/customers/K0002/phone-books/100
and following body:
{
"href": "/api/customers/K0002/phone-books/100"
}
/api/customers/K0002/phone-books/100 HTTP/1.1 200 OK {
"href": "/api/customers/K0002/phone-books/100",
"data": [{
"name": "displayName",
"value": "Phone Book"
}, {
"name": "displayNumber",
"value": "+49 (66) 1234-555"
}]
}
/api/customers/K0002/phone-books application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "Phone Book"
}, {
"name": "displayNumber",
"value": "+49 (66) 1234-555"
}]
}
Then I should receive HTTP/1.1 201 Created http://localhost:9998/api/customers/K0002/phone-books/100
and following body:
{
"href": "/api/customers/K0002/phone-books/100"
}
/api/customers/K0002/phone-books/100 HTTP/1.1 200 OK {
"href": "/api/customers/K0002/phone-books/100",
"data": [{
"name": "displayName",
"value": "Phone Book"
}, {
"name": "displayNumber",
"value": "+49 (66) 1234-555"
}]
}
/api/customers/K0002/phone-books 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 application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "invalid=name"
}, {
"name": "displayNumber",
"value": "+49 (66) 1234-555"
}]
}
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 application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "very long, long, long, long, long, long, long, long name"
}, {
"name": "displayNumber",
"value": "+49 (66) 1234-555"
}]
}
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 application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "name"
}, {
"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/K0404/phone-books application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "Phone Book"
}, {
"name": "displayNumber",
"value": "+49 (66) 1234-555"
}]
}
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 application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "Phone Book"
}, {
"name": "displayNumber",
"value": "+49 (66) 1234-555"
}]
}
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 application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "Phone Book"
}, {
"name": "displayNumber",
"value": "+49 (66) 1234-555"
}]
}
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 application/json; charset=UTF-8
and following body:
{
"data": [{
"name": "displayName",
"value": "Phone Book"
}, {
"name": "displayNumber",
"value": "+49 (66) 1234-555"
}]
}
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"
}