Api >

Service Portal REST API

GET returns all Pbx Groups
Given I am authenticated as Admin
and there is a Pbx Group with name Pbx1
and there is another Pbx Group with name pbx name 1
and there is another Pbx Group with name pbx name 2
and there is another Pbx Group with name pbx name 3
and there is another Pbx Group with name pbx name 4
When I send /api/pbx-groups
Then I should receive HTTP/1.1 200 OK with following body:
{
  "href": "/api/pbx-groups?_offset=0&_pagesize=16&_orderBy=name&_order=ASC",
  "offset": 0,
  "total": 3,
  "size": 3,
  "links": [],
  "items": [{
    "href": "/api/pbx-groups/pbx%20name%201",
    "links": [],
    "data": [{
      "name": "name",
      "value": "pbx name 1"
    }]
  }, {
    "href": "/api/pbx-groups/pbx%20name%202",
    "links": [],
    "data": [{
      "name": "name",
      "value": "pbx name 2"
    }]
  }, {
    "href": "/api/pbx-groups/Pbx1",
    "links": [],
    "data": [{
      "name": "name",
      "value": "Pbx1"
    }]
  }]
}
GET returns filtered Pbx Groups
Filtering is done on fields:
  • name
Given I am authenticated as Admin
and there is a Pbx Group with name Pbx1
and there is another Pbx Group with name Pbx2
When I send /api/pbx-groups?_q=1
Then I should receive HTTP/1.1 200 OK with following body:
{
  "href": "/api/pbx-groups?_offset=0&_pagesize=16&_q=1&_orderBy=name&_order=ASC",
  "offset": 0,
  "total": 2,
  "size": 2,
  "links": [],
  "items": [{
    "href": "/api/pbx-groups/pbx%20name%201",
    "links": [],
    "data": [{
      "name": "name",
      "value": "pbx name 1"
    }]
  }, {
    "href": "/api/pbx-groups/Pbx1",
    "links": [],
    "data": [{
      "name": "name",
      "value": "Pbx1"
    }]
  }]
}
Customer cannot access Pbx Groups
Given I am authenticated as Customer C0003
When I send /api/pbx-groups
Then I should receive HTTP/1.1 403 Forbidden
And Content-Type header should be application/api-problem+json
with following body:
{
  "detail": "Required role is missing",
  "title": "Access forbidden",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot access Pbx Groups
Given I am authenticated as System Integrator S0002
When I send /api/pbx-groups
Then I should receive HTTP/1.1 403 Forbidden
with following body
{
  "detail": "Required role is missing",
  "title": "Access forbidden",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Operator cannot access Pbx Groups
Given I am authenticated as Operator C0002
When I send /api/pbx-groups
Then I should receive HTTP/1.1 403 Forbidden
with following body
{
  "detail": "Required role is missing",
  "title": "Access forbidden",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}