/api/customers/K0002/announcements Part Name: audiofile Content Type: audio/x-wavclasspath:net/nfon/portal/api/customer/announcement/announcement.wav
Part Name: body Content Type: application/json{
"data": [{
"name": "name",
"value": "announcement.wav"
}, {
"name": "type",
"value": "MUSIC_ON_HOLD_SKILL"
}]
}HTTP/1.1 201 Created http://localhost:9998/api/customers/K0002/announcements/100
and body:
{
"href": "/api/customers/K0002/announcements/100"
}
/api/customers/K0002/announcements/100 HTTP/1.1 200 OK
with following body:
{
"href": "/api/customers/K0002/announcements/100",
"links": [],
"data": [{
"name": "name",
"value": "announcement.wav"
}, {
"name": "type",
"value": "MUSIC_ON_HOLD_SKILL"
}, {
"name": "duration",
"value": 8
}]
}
/api/customers/K0002/announcements/100 with header audio/x-wavHTTP/1.1 200 OK
with audio/x-wav
/api/customers/K0002/announcements Part Name: audiofile Content Type: audio/x-wavclasspath:net/nfon/portal/api/customer/announcement/announcement.wav
Part Name: body Content Type: application/json{
"data": [{
"name": "name",
"value": "announcement.mp3"
}, {
"name": "type",
"value": "MUSIC_ON_HOLD_SKILL"
}]
}HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Announcement name must be unique",
"path": "name",
"value": "announcement.mp3"
}]
}
/api/customers/K0002/announcements Part Name: audiofile Content Type: audio/x-wavclasspath:net/nfon/portal/api/customer/announcement/fileSizeExceeds.wav
Part Name: body Content Type: application/json{
"data": [{
"name": "name",
"value": "fileSizeExceeds.wav"
}, {
"name": "type",
"value": "GENERAL_ANNOUNCEMENT"
}]
}HTTP/1.1 400 Bad Request {
"detail": "Could not create or update resource due to constraint violations",
"title": "Validation error",
"errors": [{
"message": "Announcement file size exceeds the limit of 7340032 bytes (about 7 MB)",
"path": "file",
"value": 7954510
}],
"described_by": "http://api.nfon.net/probs/validation-error"
}
/api/customers/K0002/announcements Part Name: audiofile Content Type: audio/x-wavclasspath:net/nfon/portal/api/customer/announcement/announcement.wav
Part Name: body Content Type: application/json{
"data": [{
"name": "name",
"value": null
}, {
"name": "type",
"value": "MUSIC_ON_HOLD_SKILL"
}]
}HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Announcement name is required",
"path": "name",
"value": null
}]
}
/api/customers/K0002/announcements Part Name: audiofile Content Type: audio/x-wavclasspath:net/nfon/portal/api/customer/announcement/announcement.wav
Part Name: body Content Type: application/json{
"data": [{
"name": "name",
"value": "announcement.wav"
}, {
"name": "type",
"value": "INVALID"
}]
}HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Unknown enum value. Allowed values: [MUSIC_ON_HOLD, MUSIC_ON_HOLD_QUEUE, MUSIC_ON_HOLD_SKILL, GENERAL_ANNOUNCEMENT]",
"path": "type",
"value": "INVALID"
}]
}
/api/customers/K0002/announcements Part Name: audiofile Content Type: audio/x-wavclasspath:net/nfon/portal/api/customer/announcement/announcement.wav
Part Name: body Content Type: application/json{
"data": [{
"name": "name",
"value": "announcement.wav"
}, {
"name": "type",
"value": null
}]
}HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Announcement type is required",
"path": "type",
"value": null
}]
}
/api/customers/K0002/announcements Part Name: audiofile Content Type: audio/x-wavclasspath:net/nfon/portal/api/customer/announcement/announcement.wav
Part Name: body Content Type: application/json{
"data": [{
"name": "name",
"value": "announcement.wav"
}, {
"name": "type",
"value": "MUSIC_ON_HOLD"
}]
}HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Customer can only have one MUSIC_ON_HOLD announcement",
"path": "type",
"value": "MUSIC_ON_HOLD"
}]
}
/api/customers/K0002/announcements Part Name: audiofile Content Type: audio/x-wavclasspath:net/nfon/portal/api/customer/announcement/not_audio.gif
Part Name: body Content Type: application/json{
"data": [{
"name": "name",
"value": "not_audio.gif"
}, {
"name": "type",
"value": "MUSIC_ON_HOLD_SKILL"
}]
}HTTP/1.1 400 Bad Request {
"errors": [{
"message": "File 'not_audio.gif' is not a WAV/MP3 file.",
"path": "audiofile"
}]
}
/api/customers/K0404/announcements Part Name: audiofile Content Type: audio/x-wavclasspath:net/nfon/portal/api/customer/announcement/announcement.wav
Part Name: body Content Type: application/json{
"data": [{
"name": "name",
"value": "announcement.wav"
}, {
"name": "type",
"value": "MUSIC_ON_HOLD_SKILL"
}]
}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/K0003/announcements Part Name: audiofile Content Type: audio/x-wavclasspath:net/nfon/portal/api/customer/announcement/announcement.wav
Part Name: body Content Type: application/json{
"data": [{
"name": "name",
"value": "announcement.wav"
}, {
"name": "type",
"value": "MUSIC_ON_HOLD_SKILL"
}]
}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 Part Name: audiofile Content Type: audio/x-wavclasspath:net/nfon/portal/api/customer/announcement/announcement.wav
Part Name: body Content Type: application/json{
"data": [{
"name": "name",
"value": "announcement.wav"
}, {
"name": "type",
"value": "MUSIC_ON_HOLD_SKILL"
}]
}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 Part Name: audiofile Content Type: audio/x-wavclasspath:net/nfon/portal/api/customer/announcement/announcement.wav
Part Name: body Content Type: application/json{
"data": [{
"name": "name",
"value": "announcement.wav"
}, {
"name": "type",
"value": "MUSIC_ON_HOLD_SKILL"
}]
}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"
}