Api >

Service Portal REST API

GET returns Operator's Pbx Group
Given I am authenticated as Operator C0002
and there is a Pbx Group with name Pbx1 which is assigned to Operator C0002
When I send /api/operators/C0002/pbx-groups/Pbx1
Then I should receive HTTP/1.1 200 OK with following body:
{
  "href": "/api/operators/C0002/pbx-groups/Pbx1",
  "links": [],
  "data": [{
    "name": "name",
    "value": "Pbx1"
  }]
}
GET returns 404 if Operator is missing
Given I am authenticated as Admin
and there is no customer with id C0404 When I send /api/operators/C0404/pbx-groups/Pbx1
Then I should receive HTTP/1.1 404 Not Found with following body:
{
  "detail": "Operator C0404 has not been found",
  "title": "Operator not found",
  "described_by": "http://api.nfon.net/probs/operator-not-found"
}
GET returns 404 if PbxGroup is missing
Given I am authenticated as Operator C0002
and there is no Pbx Group with name Pbx1 When I send /api/operators/C0002/pbx-groups/Pbx1
Then I should receive HTTP/1.1 404 Not Found with following body:
{
  "detail": "Pbx Group with name Pbx1 has not been found",
  "title": "Pbx Group not found",
  "described_by": "http://api.nfon.net/probs/pbx-group-not-found"
}
Customer should not be able to GET Operator's Pbx Group
Given I am authenticated as Customer C0003
When I send /api/operators/C0002/pbx-groups/Pbx1
Then I should receive HTTP/1.1 403 Forbidden
And Content-Type header should be application/api-problem+json
with following body:
{
  "title": "Access forbidden",
  "detail": "Access denied to [Operator] with id [C0002]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot access Pbx Group of Operator
Given I am authenticated as System Integrator S0002
When I send /api/operators/C0002/pbx-groups/Pbx1
Then I should receive HTTP/1.1 403 Forbidden
with following body
{
  "title": "Access forbidden",
  "detail": "Access denied to [Operator] with id [C0002]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Operator cannot access another Operator's Pbx Group
Given I am authenticated as Operator C0002
When I send /api/operators/C0003/pbx-groups/Pbx1
Then I should receive HTTP/1.1 403 Forbidden
with following body
{
  "title": "Access forbidden",
  "detail": "Access denied to [Operator] with id [C0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}