Api >

Service Portal REST API

DELETE removes Operator's Softswitch
Given I am authenticated as Admin
and there is a Softswitch with id: 100
When I send /api/operators/C0002/softswitches/100
Then I should receive HTTP/1.1 204 No Content
Given I am authenticated as Admin
When I send /api/operators/C0002/softswitches/100
Then I should receive HTTP/1.1 404 Not Found
Cannot remove Operator's Softswitch if it is referenced by Trunk or other Softswitch
Given I am authenticated as Admin
and there is a Softswitch with id: 100
which has failoverSoftswitch with ID 200
And there is a Trunk with ID 12
which:
  • has baseNumber: +48 (22) 123456
  • has numberblockStart: 0
  • has numberblockEnd: 20
  • links to Softswitch with ID: 200
When I send /api/operators/C0002/softswitches/200
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Softswitch [200] is referenced by Trunk [+48 (22) 123456(00-20)]"
  }, {
    "message": "Softswitch [200] is referenced by another Softswitch [100]"
  }]
}
Given I am authenticated as Admin
When I send /api/operators/C0002/softswitches/200
Then I should receive HTTP/1.1 200 OK
DELETE returns 404 if Operator is missing
Given I am authenticated as Admin
and there is no Operator with id C0404 When I send /api/operators/C0404/softswitches/100
Then I should receive HTTP/1.1 404 Not Found with following body:
{
  "detail": "Operator C0404 has not been found",
  "title": "Operator not found",
  "described_by": "http://api.nfon.net/probs/operator-not-found"
}
DELETE returns 404 if Softswitch does not belong to the given Operator
Given I am authenticated as Admin
and there is a Softswitch with id: 100 that belongs to Operator C0003
When I send /api/operators/C0002/softswitches/100
Then I should receive HTTP/1.1 404 Not Found with following body:
{
  "detail": "Softswitch with ID 100 has not been found",
  "title": "Softswitch not found",
  "described_by": "http://api.nfon.net/probs/softswitch-not-found"
}
DELETE returns 404 if Softswitch is missing
Given I am authenticated as Admin
and there is no Softswitch with id 404 When I send /api/operators/C0002/softswitches/404
Then I should receive HTTP/1.1 404 Not Found with following body:
{
  "detail": "Softswitch with ID 404 has not been found",
  "title": "Softswitch not found",
  "described_by": "http://api.nfon.net/probs/softswitch-not-found"
}
Customer cannot remove Operator's Softswitch
Given I am authenticated as Customer C0003
When I send /api/operators/C0002/softswitches/100
Then I should receive HTTP/1.1 403 Forbidden
And Content-Type header should be application/api-problem+json
with following body:
{
  "title": "Access forbidden",
  "detail": "Access denied to [Operator] with id [C0002]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot remove Operator's Softswitch
Given I am authenticated as System Integrator S0002
When I send /api/operators/C0002/softswitches/100
Then I should receive HTTP/1.1 403 Forbidden
with following body
{
  "title": "Access forbidden",
  "detail": "Access denied to [Operator] with id [C0002]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Operator cannot remove Operator's Softswitch
Given I am authenticated as Operator C0002
When I send /api/operators/C0002/softswitches/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"
}