Api >

Service Portal REST API

GET returns available phones for given Operator Panel
Given I am authenticated as customer K0002
And there is Operator Panel Device with Mac Address 01-23-45-67-89-ab
And there is available Standard Device with Unique Identifier 00-11-22-33-44 and Device Type name deviceTypeName
When I send/api/customers/K0002/devices/operator-panel/available-phones
Then I should get HTTP/1.1 200 OK
And response should contain link to Operator Panel
{
  "href": "/api/customers/K0002/devices/operator-panel/available-phones?_offset=0&_pagesize=16",
  "offset": 0,
  "total": 1,
  "size": 1,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/devices/standard/00-11-22-33-44",
    "links": [],
    "data": [{
      "name": "uniqueIdentifier",
      "value": "00-11-22-33-44"
    }, {
      "name": "deviceMasterCategory",
      "value": "STANDARD"
    }, {
      "name": "deviceCategory",
      "value": "standard"
    }, {
      "name": "deviceTypeName",
      "value": "deviceTypeName"
    }]
  }]
}
GET returns filtered available phones for given Operator Panel
Given I am authenticated as customer K0002
And there is Operator Panel Device with Mac Address 01-23-45-67-89-ab
And there is available Standard Device with Unique Identifier 00-11-22-33-44 and Device Type name deviceTypeName
And there is another available Standard Device with Unique Identifier 00-55-22-33-44 and Device Type name deviceTypeName2
When I send/api/customers/K0002/devices/operator-panel/available-phones?_q=55
Then I should get HTTP/1.1 200 OK
And response should contain link to Operator Panel
{
  "href": "/api/customers/K0002/devices/operator-panel/available-phones?_offset=0&_pagesize=16&_q=55",
  "offset": 0,
  "total": 1,
  "size": 1,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/devices/standard/00-55-22-33-44",
    "links": [],
    "data": [{
      "name": "uniqueIdentifier",
      "value": "00-55-22-33-44"
    }, {
      "name": "deviceMasterCategory",
      "value": "STANDARD"
    }, {
      "name": "deviceCategory",
      "value": "standard"
    }, {
      "name": "deviceTypeName",
      "value": "deviceTypeName2"
    }]
  }]
}
Cannot read data for missing Customer
Given I am authenticated as Admin
When I send /api/customers/K0404/devices/operator-panel/available-phones
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
  "described_by": "http://api.nfon.net/probs/customer-not-found",
  "title": "Customer not found",
  "detail": "Customer with identifier K0404 has not been found"
}
Customer cannot read Operator Panel of another Customer
Given I am authenticated as K0003
And there is Operator Panel Device with Mac Address 01-23-45-67-89-ab
When I /api/customers/K0002/devices/operator-panel/available-phones
Then I should get HTTP/1.1 403 Forbidden
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0002]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot access Available Phones of Customer that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/devices/operator-panel/available-phones
Then I should receive HTTP/1.1 403 Forbidden
with following body
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Operator cannot access Available Phones of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/devices/operator-panel/available-phones
Then I should receive HTTP/1.1 403 Forbidden
with following body
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}