Api >

Service Portal REST API

GET list of Customers as Operator
Given I am authenticated as C0002
and there is a Customer with ID K0002
and there is another Customer with ID K0022 which has been blocked at 2025-07-16 07:00 and is on trial period
and there is another Customer with ID K0023 which has been blocked at 2015-09-27 19:59 and is on trial period
When I send /api/operators/C0002/customers
Then I should receive HTTP/1.1 200 OK
with following body
{
  "href": "/api/operators/C0002/customers?_offset=0&_pagesize=16&_orderBy=externalIdentifier&_order=ASC",
  "offset": 0,
  "total": 2,
  "size": 2,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002",
    "links": [],
    "data": [{
      "name": "externalIdentifier",
      "value": "K0002"
    }, {
      "name": "name",
      "value": "customer"
    }, {
      "name": "systemIntegratorName",
      "value": "S0002"
    }, {
      "name": "systemIntegrator",
      "value": "S0002"
    }, {
      "name": "operatorName",
      "value": "C0002"
    }, {
      "name": "operator",
      "value": "C0002"
    }, {
      "name": "pbxGroup",
      "value": "pbx name 1"
    }, {
      "name": "sipServer",
      "value": "127.0.0.1"
    }, {
      "name": "blockedAt",
      "value": null
    }, {
      "name": "trialPeriod",
      "value": false
    }, {
      "name": "trialPermanent",
      "value": false
    }, {
      "name": "contractType",
      "value": "ncomplete"
    }, {
      "name": "contractTypeId",
      "value": 4
    }, {
      "name": "state",
      "value": "activeWithElements"
    }]
  }, {
    "href": "/api/customers/K0022",
    "links": [],
    "data": [{
      "name": "externalIdentifier",
      "value": "K0022"
    }, {
      "name": "name",
      "value": "customer"
    }, {
      "name": "systemIntegratorName",
      "value": "S0002"
    }, {
      "name": "systemIntegrator",
      "value": "S0002"
    }, {
      "name": "operatorName",
      "value": "C0002"
    }, {
      "name": "operator",
      "value": "C0002"
    }, {
      "name": "pbxGroup",
      "value": "aaa111"
    }, {
      "name": "sipServer",
      "value": "127.0.0.1"
    }, {
      "name": "blockedAt",
      "value": "2025-07-16 07:00"
    }, {
      "name": "trialPeriod",
      "value": true
    }, {
      "name": "trialPermanent",
      "value": false
    }, {
      "name": "contractType",
      "value": "nlight"
    }, {
      "name": "contractTypeId",
      "value": 12
    }, {
      "name": "state",
      "value": "blocked"
    }]
  }]
}
GET filtered list of Customers
Filtering is done on fields :
  • externalIdentifier
  • name
  • systemIntegratorName
  • systemIntegrator (external identifier)
  • operatorName
  • operator (external identifier)
  • pbxGroup
  • sipServer
  • contractType
  • contractTypeId
  • state
Given I am authenticated as C0002
and there is a Customer with ID K0002
and there is another Customer with ID K0022
When I send /api/operators/C0002/customers?_q=22
Then I should receive HTTP/1.1 200 OK
with following body
{
  "href": "/api/operators/C0002/customers?_offset=0&_pagesize=16&_q=22&_orderBy=externalIdentifier&_order=ASC",
  "offset": 0,
  "total": 1,
  "size": 1,
  "links": [],
  "items": [{
    "href": "/api/customers/K0022",
    "links": [],
    "data": [{
      "name": "externalIdentifier",
      "value": "K0022"
    }, {
      "name": "name",
      "value": "customer"
    }, {
      "name": "systemIntegratorName",
      "value": "S0002"
    }, {
      "name": "systemIntegrator",
      "value": "S0002"
    }, {
      "name": "operatorName",
      "value": "C0002"
    }, {
      "name": "operator",
      "value": "C0002"
    }, {
      "name": "pbxGroup",
      "value": "aaa111"
    }, {
      "name": "sipServer",
      "value": "127.0.0.1"
    }, {
      "name": "blockedAt",
      "value": null
    }, {
      "name": "trialPeriod",
      "value": false
    }, {
      "name": "trialPermanent",
      "value": false
    }]
  }]
}
Customer cannot get list of Customers
Given I am authenticated as K0003
When I send /api/operators/C0002/customers
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"
}
System Integrator cannot get list of Customers
Given I am authenticated as S0002
When I send /api/operators/C0002/customers
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 get list of other Operator's Customers
Given I am authenticated as C0002
When I send /api/operators/C0003/customers
Then I should receive HTTP/1.1 403 Forbidden
with following body
{
  "title": "Access forbidden",
  "detail": "Access denied to [Operator] with id [C0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Admin cannot get list of not existing Operator
Given I am authenticated as Admin
and there is no Operator C0404 When I send /api/operators/C0404/customers
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"
}