Api >

Service Portal REST API

GET returns all Operator's Pbx Groups
Given I am authenticated as Operator C0002
and there is a Pbx Group with name Pbx1 which is assigned to Operator C0002
and there is another Pbx Group with name pbx name which is assigned to Operator C0002
When I send /api/operators/C0002/pbx-groups
Then I should receive HTTP/1.1 200 OK with following body:
{
  "href": "/api/operators/C0002/pbx-groups?_offset=0&_pagesize=16&_orderBy=name&_order=ASC",
  "offset": 0,
  "total": 2,
  "size": 2,
  "links": [],
  "items": [{
    "href": "/api/operators/C0002/pbx-groups/pbx%20name%201",
    "links": [],
    "data": [{
      "name": "name",
      "value": "pbx name 1"
    }]
  }, {
    "href": "/api/operators/C0002/pbx-groups/Pbx1",
    "links": [],
    "data": [{
      "name": "name",
      "value": "Pbx1"
    }]
  }]
}
GET returns filtered Operator's Pbx Groups
Filtering is done on fields:
  • name
Given I am authenticated as Operator C0002
and there is a Pbx Group with name Pbx1 which is assigned to Operator C0002
and there is another Pbx Group with name Pbx2 which is assigned to Operator C0002
When I send /api/operators/C0002/pbx-groups?_q=2
Then I should receive HTTP/1.1 200 OK with following body:
{
  "href": "/api/operators/C0002/pbx-groups?_offset=0&_pagesize=16&_q=2&_orderBy=name&_order=ASC",
  "offset": 0,
  "total": 1,
  "size": 1,
  "links": [],
  "items": [{
    "href": "/api/operators/C0002/pbx-groups/Pbx2",
    "links": [],
    "data": [{
      "name": "name",
      "value": "Pbx2"
    }]
  }]
}
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
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"
}
Customer should not be able to GET Operator's Pbx Groups
Given I am authenticated as Customer C0003
When I send /api/operators/C0002/pbx-groups
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 Groups of Operator
Given I am authenticated as System Integrator S0002
When I send /api/operators/C0002/pbx-groups
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 Groups
Given I am authenticated as Operator C0002
When I send /api/operators/C0003/pbx-groups
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"
}