Api >

Service Portal REST API

GET returns Operator's Softswitch
Given I am authenticated as Operator C0002
and there is a Softswitch with id: 100 and:
  • name: SoftswitchName1
  • identifier: dns
  • cidType: ENUM_164_00
  • dialType: ENUM_164_PLUS
  • privacyType: ANONYMOUS
  • trunkExtensionAvailable: true
  • privateUse: true
  • primaryCodec: codec
  • failoverSoftswitch with ID 200
When I send /api/operators/C0002/softswitches/100
Then I should receive HTTP/1.1 200 OK with following body:
{
  "href": "/api/operators/C0002/softswitches/100",
  "links": [{
    "rel": "failoverSoftswitch",
    "href": "/api/operators/C0002/softswitches/200"
  }, {
    "rel": "availableFailoverSoftswitches",
    "href": "/api/operators/C0002/softswitches"
  }],
  "data": [{
    "name": "name",
    "value": "SoftswitchName1"
  }, {
    "name": "identifier",
    "value": "dns"
  }, {
    "name": "cidType",
    "value": "ENUM_164_00"
  }, {
    "name": "dialType",
    "value": "ENUM_164_PLUS"
  }, {
    "name": "failoverSoftswitch",
    "value": "softswitch200"
  }, {
    "name": "selectableByOperator",
    "value": false
  }, {
    "name": "privacyType",
    "value": "ANONYMOUS"
  }, {
    "name": "trunkExtensionAvailable",
    "value": true
  }, {
    "name": "privateUse",
    "value": true
  }, {
    "name": "primaryCodec",
    "value": "codec"
  }]
}
GET returns null link to failoverSoftswitch if it has not been set
Given I am authenticated as Operator C0002
and there is a Softswitch with id: 100 and:
  • identifier: dns
  • no failoverSoftswitch
When I send /api/operators/C0002/softswitches/100
Then I should receive HTTP/1.1 200 OK with following body:
{
  "href": "/api/operators/C0002/softswitches/100",
  "links": [{
    "rel": "failoverSoftswitch",
    "href": null
  }]
}
GET 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"
}
GET returns 404 if Softswitch does not belong to the given Operator
Given I am authenticated as Operator C0002
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"
}
GET returns 404 if Softswitch is missing
Given I am authenticated as Operator C0002
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 access 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 access 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"
}