Api >

Service Portal REST API

Admin can read all Sip Servers
Given I am authenticated as Admin
and there is a Pbx Group with name Pbx1 And there is a Sip Server with:
  • ID: 100
  • name: sipServerName
  • externalIp: 192.168.1.1
  • location: Location
  • pbxGroup with name Pbx1
  • description: 4xE5504-2GHZ;4GB
  • partition: P01
  • maxSubscribers: 1000
And there is another Sip Server with:
  • ID: 200
  • name: anotherSipServerName
  • externalIp: 192.168.1.2
  • location: Location 2
  • pbxGroup with name Pbx2
  • description: 4xE5504-2GHZ;8GB
  • partition: P02
  • maxSubscribers: 2000
And there is another Sip Server with ID 1
And there is another Sip Server with ID 2
When I send /api/sip-servers
Then I should receive HTTP/1.1 200 OK
with body:
{
  "href": "/api/sip-servers?_offset=0&_pagesize=16",
  "offset": 0,
  "total": 4,
  "size": 4,
  "links": [],
  "items": [{
    "href": "/api/sip-servers/1",
    "links": [],
    "data": [{
      "name": "name",
      "value": "sipServer"
    }, {
      "name": "externalIp",
      "value": "88.100.100.101"
    }, {
      "name": "location",
      "value": null
    }, {
      "name": "pbxGroup",
      "value": "pbx name 1"
    }, {
      "name": "description",
      "value": null
    }, {
      "name": "partition",
      "value": "P01"
    }, {
      "name": "maxSubscribers",
      "value": 100
    }]
  }, {
    "href": "/api/sip-servers/2",
    "links": [],
    "data": [{
      "name": "name",
      "value": "sipServer2"
    }, {
      "name": "externalIp",
      "value": "88.100.100.101"
    }, {
      "name": "location",
      "value": null
    }, {
      "name": "pbxGroup",
      "value": "pbx name 2"
    }, {
      "name": "description",
      "value": null
    }, {
      "name": "partition",
      "value": "P01"
    }, {
      "name": "maxSubscribers",
      "value": 100
    }]
  }, {
    "href": "/api/sip-servers/100",
    "links": [],
    "data": [{
      "name": "name",
      "value": "sipServerName"
    }, {
      "name": "externalIp",
      "value": "192.168.1.1"
    }, {
      "name": "location",
      "value": "Location"
    }, {
      "name": "pbxGroup",
      "value": "Pbx1"
    }, {
      "name": "description",
      "value": "4xE5504-2GHZ;4GB"
    }, {
      "name": "partition",
      "value": "P01"
    }, {
      "name": "maxSubscribers",
      "value": 1000
    }]
  }, {
    "href": "/api/sip-servers/200",
    "links": [],
    "data": [{
      "name": "name",
      "value": "anotherSipServerName"
    }, {
      "name": "externalIp",
      "value": "192.168.1.2"
    }, {
      "name": "location",
      "value": "Location 2"
    }, {
      "name": "pbxGroup",
      "value": "Pbx2"
    }, {
      "name": "description",
      "value": "4xE5504-2GHZ;8GB"
    }, {
      "name": "partition",
      "value": "P02"
    }, {
      "name": "maxSubscribers",
      "value": 2000
    }]
  }]
}
Admin can read filtered Sip Servers
Filtering is done on fields:
  • name
  • externalIp
  • location
  • pbxGroup
  • description
  • partition
  • maxSubscribers
Given I am authenticated as Admin
And there is a Sip Server with:
  • ID: 100
  • name: sipServerName
  • externalIp: 192.168.1.1
  • location: Location
  • pbxGroup with name Pbx1
  • description: 4xE5504-2GHZ;4GB
  • partition: P01
  • maxSubscribers: 1000
And there is another Sip Server with:
  • ID: 200
  • name: anotherSipServerName
  • externalIp: 192.168.1.2
  • location: Location 2
  • pbxGroup with name Pbx2
  • description: 4xE5504-2GHZ;8GB
  • partition: P02
  • maxSubscribers: 2000
And there is another Sip Server with ID 1
And there is another Sip Server with ID 2
When I send /api/sip-servers?_q=another
Then I should receive HTTP/1.1 200 OK
with body:
{
  "href": "/api/sip-servers?_offset=0&_pagesize=16&_q=another",
  "offset": 0,
  "total": 1,
  "size": 1,
  "links": [],
  "items": [{
    "href": "/api/sip-servers/200",
    "links": [],
    "data": [{
      "name": "name",
      "value": "anotherSipServerName"
    }, {
      "name": "externalIp",
      "value": "192.168.1.2"
    }, {
      "name": "location",
      "value": "Location 2"
    }, {
      "name": "pbxGroup",
      "value": "Pbx2"
    }, {
      "name": "description",
      "value": "4xE5504-2GHZ;8GB"
    }, {
      "name": "partition",
      "value": "P02"
    }, {
      "name": "maxSubscribers",
      "value": 2000
    }]
  }]
}
Customer cannot read Sip Servers
Given I am authenticated as Customer K0002
When I send /api/sip-servers
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"
}
System Integrator cannot read Sip Servers
Given I am authenticated as System Integrator S0002
When I send /api/sip-servers
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 read Sip Servers
Given I am authenticated as Operator C0002
When I send /api/sip-servers
Then I should receive HTTP/1.1 403 Forbidden
with following body:
{
  "title": "Access forbidden",
  "detail": "Required role is missing",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}