Api >

Service Portal REST API

GET a list of available general announcements for Skill Services
Given I am authenticated as customer K0002
and there is a GENERAL_ANNOUNCEMENT announcement with ID 1010
, name announcement 1 and file name filename1.wav
and there is another GENERAL_ANNOUNCEMENT announcement with ID 1010
, name announcement 2 and file name filename2.wav
and there is a MUSIC_ON_HOLD_QUEUE announcement with ID 1011, name anotherAnnouncement and file name filename3.wav
When I send /api/customers/K0002/targets/skill-services/available-general-announcements
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/targets/skill-services/available-general-announcements?_offset=0&_pagesize=16",
  "offset": 0,
  "total": 2,
  "size": 2,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/announcements/1010",
    "links": [],
    "data": [{
      "name": "name",
      "value": "announcement 1"
    }]
  }, {
    "href": "/api/customers/K0002/announcements/1011",
    "links": [],
    "data": [{
      "name": "name",
      "value": "announcement 2"
    }]
  }]
}
GET retrieves list of available general announcements for Skill Services
Filtering is done on fields :
  • name
Given I am authenticated as customer K0002
and there is a GENERAL_ANNOUNCEMENT announcement with ID 1010
, name announcement 1 and file name filename1.wav
and there is another GENERAL_ANNOUNCEMENT announcement with ID 1010
, name announcement 2 and file name filename2.wav
and there is a MUSIC_ON_HOLD_QUEUE announcement with ID 1011, name anotherAnnouncement and file name filename3.wav
When I send /api/customers/K0002/targets/skill-services/available-general-announcements?_q=2
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/targets/skill-services/available-general-announcements?_offset=0&_pagesize=16&_q=2",
  "offset": 0,
  "total": 1,
  "size": 1,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/announcements/1011",
    "links": [],
    "data": [{
      "name": "name",
      "value": "announcement 2"
    }]
  }]
}
Missing Customer
Given I am authenticated as Admin
When I send /api/customers/K404/targets/skill-services/available-general-announcements
Then I should receive HTTP/1.1 404 Not Found
{
  "title": "Customer not found",
  "detail": "Customer with identifier K404 has not been found",
  "described_by": "http://api.nfon.net/probs/customer-not-found"
}
Customer should not be able to GET another Customer's available announcements
Given I am authenticated as Customer K0003
When I send /api/customers/K0002/targets/skill-services/available-general-announcements
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"
}
System Integrator should not be able to GET data of a Customer that he cannot manage
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/targets/skill-services/available-general-announcements
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"
}
Operator should not be able to GET data of a Customer that he cannot manage
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/skill-services/available-general-announcements
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"
}