Api >

Service Portal REST API

Admin can read Sip Server's data
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
  • externalIp: 192.168.1.2
  • location: Location
  • pbxGroup with name Pbx1
  • description: 4xE5504-2GHZ;4GB
  • partition: P01
  • maxSubscribers: 1000
  • maxSubscribers: 500
When I send /api/sip-servers/100
Then I should receive HTTP/1.1 200 OK
with body:
{
  "href": "/api/sip-servers/100",
  "links": [{
    "rel": "pbxGroup",
    "href": "/api/pbx-groups/Pbx1"
  }, {
    "rel": "availablePbxGroup",
    "href": "/api/pbx-groups"
  }],
  "data": [{
    "name": "name",
    "value": "sipServerName"
  }, {
    "name": "externalIp",
    "value": "192.168.1.1"
  }, {
    "name": "internalIp",
    "value": "192.168.1.2"
  }, {
    "name": "maxSubscribers",
    "value": 1000
  }, {
    "name": "subscribersLimit",
    "value": 500
  }, {
    "name": "location",
    "value": "Location"
  }, {
    "name": "partition",
    "value": "P01"
  }, {
    "name": "description",
    "value": "4xE5504-2GHZ;4GB"
  }]
}
Admin cannot read missing Sip Server's data
Given I am authenticated as Admin
And there is no Sip Server with ID 404
When I send /api/sip-servers/404
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
  "detail": "Sip Server with ID 404 has not been found",
  "title": "Sip Server not found",
  "described_by": "http://api.nfon.net/probs/sip-server-not-found"
}
Customer cannot read Sip Server's data
Given I am authenticated as Customer K0002
When I send /api/sip-servers/100
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 Server's data
Given I am authenticated as System Integrator S0002
When I send /api/sip-servers/100
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 Server's data
Given I am authenticated as Operator C0002
When I send /api/sip-servers/100
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"
}