/api/customers/K0002/announcements/15 as application/json; charset=UTF-8 {
"data": [{
"name": "name",
"value": "name changed with api"
}]
}
Then I should receive HTTP/1.1 204 No Content /api/customers/K0002/announcements/15 HTTP/1.1 200 OK
with following body:
{
"href": "/api/customers/K0002/announcements/15",
"links": [],
"data": [{
"name": "name",
"value": "name changed with api"
}, {
"name": "type",
"value": "GENERAL_ANNOUNCEMENT"
}, {
"name": "duration",
"value": 8
}]
}
/api/customers/K0002/announcements/15 as application/json; charset=UTF-8 {
"data": [{
"name": "name",
"value": "announcement_2.mp3"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Announcement name must be unique",
"path": "name",
"value": "announcement_2.mp3"
}]
}
/api/customers/K0002/announcements/15 as application/json; charset=UTF-8 {
"data": [{
"name": "name",
"value": null
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Announcement name is required",
"path": "name",
"value": null
}]
}
/api/customers/K0002/announcements/15 Part Name: audiofile Content Type: audio/mpegclasspath:net/nfon/portal/api/customer/announcement/announcement_2.mp3
Part Name: body Content Type: application/json{
"data": [{
"name": "name",
"value": "announcement_2.mp3"
}]
}HTTP/1.1 204 No Content
/api/customers/K0002/announcements/15 HTTP/1.1 200 OK
with following body:
{
"href": "/api/customers/K0002/announcements/15",
"links": [],
"data": [{
"name": "name",
"value": "announcement_2.mp3"
}, {
"name": "type",
"value": "GENERAL_ANNOUNCEMENT"
}, {
"name": "duration",
"value": 9
}]
}
/api/customers/K0002/announcements/15 Part Name: audiofile Content Type: audio/mpegclasspath:net/nfon/portal/api/customer/announcement/not_audio.gif
Part Name: body Content Type: application/json{
"data": [{
"name": "name",
"value": "not_audio.gif"
}]
}HTTP/1.1 400 Bad Request {
"errors": [{
"message": "File 'not_audio.gif' is not a WAV/MP3 file.",
"path": "audiofile"
}]
}
/api/customers/K0404/announcements/15 as application/json; charset=UTF-8 {}
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
"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/announcements/404 as application/json; charset=UTF-8 {}
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
"title": "Announcement not found",
"detail": "Announcement with id 404 has not been found",
"described_by": "http://api.nfon.net/probs/announcement-not-found"
}
/api/customers/K0002/announcements/15 as application/json; charset=UTF-8 {}
Then I should receive HTTP/1.1 403 Forbidden
with following body:
{
"title": "Access forbidden",
"detail": "Access denied to [Customer] with id [K0002]",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}
/api/customers/K0003/announcements/15 as application/json; charset=UTF-8 {}
Then I should receive HTTP/1.1 403 Forbidden
With following body
{
"title": "Access forbidden",
"detail": "Access denied to [Customer] with id [K0003]",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}
/api/customers/K0003/announcements/15 as application/json; charset=UTF-8 {}
Then I should receive HTTP/1.1 403 Forbidden
With following body
{
"title": "Access forbidden",
"detail": "Access denied to [Customer] with id [K0003]",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}