Api >

Service Portal REST API

Admin can delete not referenced Sip Server
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
When I send /api/sip-servers/100
Then I should receive HTTP/1.1 204 No Content
Given I am authenticated as Admin
When I send /api/sip-servers/100
Then I should receive HTTP/1.1 404 Not Found
with body:
{
  "detail": "Sip Server with ID 100 has not been found",
  "title": "Sip Server not found",
  "described_by": "http://api.nfon.net/probs/sip-server-not-found"
}
Admin cannot delete Sip Server if it is references by Customer
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
And it is referenced by Customer K0002 When I send /api/sip-servers/100
Then I should receive HTTP/1.1 400 Bad Request
with body:
{
  "detail": "Sip Server with ID 100 cannot be delete because it is referenced by Customer",
  "title": "Sip Server cannot be deleted",
  "described_by": "http://api.nfon.net/probs/sip-server-cannot-be-deleted"
}
Admin cannot delete missing Sip Server
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 delete Sip Server
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 delete Sip Server
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 delete Sip Server
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"
}