Api >

Service Portal REST API

GET returns Customer's Available Pbx Groups list
Given I am authenticated as Operator C0002
and there is a New Pbx Group that belongs to Operator C0002 and is attached to New Sip Server with Id 15
and there is a Another Pbx Group that belongs to Operator C0002 and does not have any Sip Servers
When I send /api/customers/K0002/available-pbx-groups
Then I should receive HTTP/1.1 200 OK
with following body
{
  "href": "/api/customers/K0002/available-pbx-groups?_offset=0&_pagesize=16&_orderBy=name&_order=ASC",
  "offset": 0,
  "total": 2,
  "size": 2,
  "links": [],
  "items": [{
    "href": "/api/operators/C0002/pbx-groups/New%20Pbx%20Group",
    "links": [],
    "data": [{
      "name": "name",
      "value": "New Pbx Group"
    }, {
      "name": "pbxGroupFreeCapacity",
      "value": 100
    }]
  }, {
    "href": "/api/operators/C0002/pbx-groups/pbx%20name%201",
    "links": [],
    "data": [{
      "name": "name",
      "value": "pbx name 1"
    }, {
      "name": "pbxGroupFreeCapacity",
      "value": 100
    }]
  }]
}
Cannot access Available Pbx Groups list
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0002/available-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"
}
Missing Customer
Given I am authenticated as admin
and there is no Customer K0404 When I send /api/customers/K0404/available-pbx-groups
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 cannot access other Customer's Available Pbx Groups list
Given I am authenticated as Customer K0002
When I send /api/customers/K0003/available-pbx-groups
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"
}
System Integrator cannot access Available Pbx Groups list of Customer that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/available-pbx-groups
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 cannot access Available Pbx Groups list of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/available-pbx-groups
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"
}