Api >

Service Portal REST API

Admin should be able to read all Operators
Given I am authenticated as Admin
And there is Operator C0002 with
  • name: Operator Name
  • contactName: Operator Contact
  • contactEmail: operator@example.com
  • contactPhone: +49 (22) 234-456
And there is another Operator C0003 with
  • name: Another Operator Name
  • contactName: Another Operator Contact
  • contactEmail: another.operator@example.com
  • contactPhone: +49 (22) 234-999
When I send /api/operators
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/operators?_offset=0&_pagesize=16",
  "offset": 0,
  "total": 2,
  "size": 2,
  "links": [],
  "items": [{
    "href": "/api/operators/C0002",
    "links": [],
    "data": [{
      "name": "identifier",
      "value": "C0002"
    }, {
      "name": "name",
      "value": "Operator Name"
    }, {
      "name": "contactName",
      "value": "Operator Contact"
    }, {
      "name": "contactEmail",
      "value": "operator@example.com"
    }, {
      "name": "contactPhone",
      "value": "+49 (22) 234-456"
    }]
  }, {
    "href": "/api/operators/C0003",
    "links": [],
    "data": [{
      "name": "identifier",
      "value": "C0003"
    }, {
      "name": "name",
      "value": "Another Operator Name"
    }, {
      "name": "contactName",
      "value": "Another Operator Contact"
    }, {
      "name": "contactEmail",
      "value": "another.operator@example.com"
    }, {
      "name": "contactPhone",
      "value": "+49 (22) 234-999"
    }]
  }]
}
Admin should be able to read filtered Operators
Filtering is done on fields:
  • identifier
  • name
  • contactName
  • contactEmail
  • contactPhone
Given I am authenticated as Admin
And there is Operator C0002 with
  • name: Operator Name
  • contactName: Operator Contact
  • contactEmail: operator@example.com
  • contactPhone: +49 (22) 234-456
And there is another Operator C0003 with
  • name: Another Operator Name
  • contactName: Another Operator Contact
  • contactEmail: another.operator@example.com
  • contactPhone: +49 (22) 234-999
When I send /api/operators?_q=Another
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/operators?_offset=0&_pagesize=16&_q=Another",
  "offset": 0,
  "total": 1,
  "size": 1,
  "links": [],
  "items": [{
    "href": "/api/operators/C0003",
    "links": [],
    "data": [{
      "name": "identifier",
      "value": "C0003"
    }, {
      "name": "name",
      "value": "Another Operator Name"
    }, {
      "name": "contactName",
      "value": "Another Operator Contact"
    }, {
      "name": "contactEmail",
      "value": "another.operator@example.com"
    }, {
      "name": "contactPhone",
      "value": "+49 (22) 234-999"
    }]
  }]
}
Customer cannot read Operators
Given I am authenticated as Customer K0002
When I send /api/operators
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 Operators
Given I am authenticated as System Integrator S0002
When I send /api/operators
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 Operators
Given I am authenticated as Operator C0002
When I send /api/operators
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"
}