Api >

Service Portal REST API

Should get a Queue Member
Given I am authenticated as customer K0002
and there is a queue service
  • with name queue name
  • with service number 345
  • and asterisk extension number 576

and it has a member with extension 698 and penalty 5
When I send /api/customers/K0002/targets/queue-services/345/members/698
Then I should receive HTTP/1.1 200 OK
And Content-Type header should be application/vnd.collection.next+json
with following body:
{
  "href": "/api/customers/K0002/targets/queue-services/345/members/698",
  "links": [{
    "rel": "phoneExtension",
    "href": "/api/customers/K0002/targets/phone-extensions/698"
  }],
  "data": [{
    "name": "penalty",
    "value": 5
  }, {
    "name": "displayName",
    "value": "Extension #698"
  }, {
    "name": "extensionNumber",
    "value": "698"
  }]
}
Missing Queue Member
Given I am authenticated as customer K0002
and there is a queue service
  • with name queue name
  • with service number 345
  • and asterisk extension number 576

and it has no members
When I send /api/customers/K0002/targets/queue-services/345/members/698
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
  "title": "Queue member not found",
  "detail": "Queue member with extension number 698 not found",
  "described_by": "http://api.nfon.net/probs/queue-member-not-found"
}
Missing Queue
Given there is no queue service with 404 identifier and I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services/404/members/698
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
  "title": "Queue not found",
  "detail": "Queue with serviceNumber 404 not found",
  "described_by": "http://api.nfon.net/probs/queue-not-found"
}
Missing Customer
Given I am authenticated as Admin
When I ask for queue for a customer that does not exist /api/customers/K404/targets/queue-services/345/members/698
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
  "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 Queue Member
Given there is a queue service
  • with name queue name
  • with service number 345
  • and asterisk extension number 576

and it has a member with extension 698 and penalty 5
and I am authenticated as Customer K0003
When I send /api/customers/K0002/targets/queue-services/345/members/698
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"
}
System Integrator should not be able to GET data of a Customer that he cannot manage
Given there is a queue service
  • with name queue name
  • with service number 345
  • and asterisk extension number 576

and it has a member with extension 698 and penalty 5
and I am authenticated as System Integrator S0002
When I send /api/customers/K0003/targets/queue-services/345/members/698
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"
}
Operator should not be able to GET data of a Customer that he cannot manage
Given there is a queue service
  • with name queue name
  • with service number 345
  • and asterisk extension number 576

and it has a member with extension 698 and penalty 5
and I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/queue-services/345/members/698
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"
}