/api/customers/K0002/phone-books/100/visibilities application/json; charset=UTF-8
and following body:
{
"links": [{
"rel": "phoneExtension",
"href": "/api/customers/K0002/targets/phone-extensions/555"
}]
}
Then I should receive HTTP/1.1 201 Created http://localhost:9998/api/customers/K0002/phone-books/100/visibilities/555
and following body:
{
"href": "/api/customers/K0002/phone-books/100/visibilities/555"
}
/api/customers/K0002/phone-books/100/visibilities/555 HTTP/1.1 200 OK {
"href": "/api/customers/K0002/phone-books/100/visibilities/555",
"links": [{
"rel": "phoneExtension",
"href": "/api/customers/K0002/targets/phone-extensions/555"
}],
"data": [{
"name": "displayName",
"value": "Extension1"
}, {
"name": "extensionNumber",
"value": "555"
}]
}
/api/customers/K0002/phone-books/100/visibilities application/json; charset=UTF-8
and following body:
{
"links": [{
"rel": "phoneExtension",
"href": "/api/customers/K0003/targets/phone-extensions/555"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Phone Extension [555] does not belongs to Customer [K0002]",
"path": "phoneExtension",
"value": "/api/customers/K0003/targets/phone-extensions/555"
}]
}
/api/customers/K0002/phone-books/100/visibilities application/json; charset=UTF-8
and following body:
{
"links": [{
"rel": "phoneExtension",
"href": "/api/customers/K0002/targets/phone-extensions/555"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Phone Book [100] is already assigned as visible for Phone Extension [555]",
"path": "phoneExtension",
"value": "/api/customers/K0002/targets/phone-extensions/555"
}]
}
/api/customers/K0002/phone-books/100/visibilities application/json; charset=UTF-8
and following body:
{
"links": [{
"rel": "phoneExtension",
"href": null
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Phone Extension cannot be null",
"path": "phoneExtension",
"value": null
}]
}
/api/customers/K0002/phone-books/404/visibilities application/json; charset=UTF-8
and following body:
{
"links": [{
"rel": "phoneExtension",
"href": "/api/customers/K0002/targets/phone-extensions/555"
}]
}
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"
}