Api >

Service Portal REST API

GET returns available Destinations link
Given I am authenticated as Customer K0002
And there is a Queue Service with Service Number 345
When I send /api/customers/K0002/targets/queue-services/345/timeout
Then I should receive HTTP/1.1 200 OK
{
  "links": [{
    "rel": "availableDestinations",
    "href": "/api/customers/K0002/targets/queue-services/available-destinations-on-timeout"
  }]
}
GET returns configured Destination on Timeout
Given I am authenticated as Customer K0002
And there is a Queue Service with Service Number 345
And it has Timeout Delay set to 2 and Destination On Timeout point to BUSY
When I send /api/customers/K0002/targets/queue-services/345/timeout
Then I should receive HTTP/1.1 200 OK
{
  "links": [{
    "rel": "destinationOnTimeout",
    "href": "/api/customers/K0002/targets/BUSY"
  }],
  "data": [{
    "name": "timeoutDelay",
    "value": 2
  }]
}
GET doesn't return Timeout for OUTBOUND
Given I am authenticated as Customer K0002
And there is a OUTBOUND Queue Service with Service Number 345
And it has Timeout Delay set to 2 and Destination On Timeout point to BUSY
When I send /api/customers/K0002/targets/queue-services/345/timeout
Then I should receive HTTP/1.1 404 Not Found
With following body :
{
  "title": "Timeouts isn\u0027t supported for this direction",
  "detail": "Timeout is not available when Service has direction \u0027OUTBOUND\u0027"
}
Cannot get Destination On Timeout for missing Queue Service
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/targets/queue-services/404/timeout
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 send /api/customers/K0404/targets/queue-services/345/timeout
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"
}
Customer should not be able to get another Customer's Queue's Destination On Timeout
Given I am authenticated as Customer K0003
When I send /api/customers/K0002/targets/queue-services/345/timeout
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 I am authenticated as System Integrator S0002
When I send /api/customers/K0003/targets/queue-services/345/timeout
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 I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/queue-services/345/timeout
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"
}