Api >

Service Portal REST API

DELETE restores overridden Site Options to default Site Options from Site
Given I am authenticated as Customer K0002
and there is a Standard Device with ID 00041323B577 of type type01
When I send /api/customers/K0002/devices/standard/00041323B577/site-options with application/json; charset=UTF-8
and body
{
  "data": [{
    "name": "language",
    "value": "en"
  }]
}
Then I should receive HTTP/1.1 204 No Content

Given I am authenticated as Customer K0002
When I send /api/customers/K0002/devices/standard/00041323B577/site-options Then I should receive HTTP/1.1 200 OK
with following body
{
  "href": "/api/customers/K0002/devices/standard/00041323B577/site-options"
}
And Device should have the same Site Options as Site
And Previously changed Device Site Options should not exist

Given I am authenticated as Customer K0002
When I send /api/customers/K0002/devices/standard/00041323B577 Then I should receive HTTP/1.1 200 OK
with following body
{
  "data": [{
    "name": "useSiteOptionsFromSite",
    "value": true
  }]
}
Should allow to restore Site Options for Device of Type XCAPI if it was not overridden
Given I am authenticated as Customer K0002
and there is a Standard Device with ID 00041323B577 of type type01
When I send /api/customers/K0002/devices/standard/00041323B577/site-options
Then I should receive HTTP/1.1 200 OK
with following body
{
  "href": "/api/customers/K0002/devices/standard/00041323B577/site-options"
}
Should not restore Site Options for Device of Type FMC
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/devices/fmc/123456789012345/site-options
Then I should receive HTTP/1.1 400 Bad Request
with following body
{
  "detail": "Site Options for Device with type [fmc] are not available",
  "title": "Site Options are not available",
  "described_by": "http://api.nfon.net/probs/site-options-not-available"
}
Should not restore Site Options for Device of Type Lync
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/devices/lync/1-48223333/site-options
Then I should receive HTTP/1.1 400 Bad Request
with following body
{
  "detail": "Site Options for Device with type [lync] are not available",
  "title": "Site Options are not available",
  "described_by": "http://api.nfon.net/probs/site-options-not-available"
}
Should not restore Site Options for Device of Type Media Gateway
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/devices/media-gateway/123456789ABC/site-options
Then I should receive HTTP/1.1 400 Bad Request
with following body
{
  "detail": "Site Options for Device with type [media-gateway] are not available",
  "title": "Site Options are not available",
  "described_by": "http://api.nfon.net/probs/site-options-not-available"
}
Should not restore Site Options for Device of Type Operator Panel
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/devices/operator-panel/01-23-45-67-89-ab/site-options
Then I should receive HTTP/1.1 400 Bad Request
with following body
{
  "detail": "Site Options for Device with type [operator-panel] are not available",
  "title": "Site Options are not available",
  "described_by": "http://api.nfon.net/probs/site-options-not-available"
}
Should restore Site Options for Device of Type Softphone
Given I am authenticated as Customer K0002
and there is an Softphone Device Type with name softphone
and there is a softphone Device with ID device123
When I send /api/customers/K0002/devices/base/device123/site-options with application/json; charset=UTF-8
and body
{
  "data": [{
    "name": "language",
    "value": "en"
  }]
}
Then I should receive HTTP/1.1 204 No Content
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/devices/base/device123/site-options
Then I should receive HTTP/1.1 200 OK
Should restore Site Options for Device of Type Base
Given I am authenticated as Customer K0002
And there is a Base Device of category Kirk with MAC 123456789ABC and Port Type IPEI
When I send /api/customers/K0002/devices/base/123456789ABC/site-options with application/json; charset=UTF-8
and body
{
  "data": [{
    "name": "language",
    "value": "en"
  }]
}
Then I should receive HTTP/1.1 204 No Content
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/devices/base/123456789ABC/site-options
Then I should receive HTTP/1.1 200 OK
Should restore Site Options for Device of Type Standard
Given I am authenticated as Customer K0002
And there is a Standard Device with ID 123456789ABC of type type01
When I send /api/customers/K0002/devices/standard/123456789ABC/site-options with application/json; charset=UTF-8
and body
{
  "data": [{
    "name": "language",
    "value": "en"
  }]
}
Then I should receive HTTP/1.1 204 No Content
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/devices/standard/123456789ABC/site-options
Then I should receive HTTP/1.1 200 OK
Should restore Site Options for Device of Type Unprovisioned SIP
Given I am authenticated as Customer K0002
And there is an UnprovisionedSip Device Type with name type01
and there is a Unprovisioned Sip Device with ID 123456789ABC
When I send /api/customers/K0002/devices/unprovisioned-sip/123456789ABC/site-options with application/json; charset=UTF-8
and body
{
  "data": [{
    "name": "language",
    "value": "en"
  }]
}
Then I should receive HTTP/1.1 204 No Content
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/devices/unprovisioned-sip/123456789ABC/site-options
Then I should receive HTTP/1.1 200 OK
Should restore Site Options for Device of Type XCAPI
Given I am authenticated as Customer K0002
and there is a XCAPI Device with ID 123456789ABC
When I send /api/customers/K0002/devices/xcapi/123456789ABC/site-options with application/json; charset=UTF-8
and body
{
  "data": [{
    "name": "language",
    "value": "en"
  }]
}
Then I should receive HTTP/1.1 204 No Content
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/devices/xcapi/123456789ABC/site-options
Then I should receive HTTP/1.1 200 OK
Missing Device
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/devices/standard/404/site-options Then I should receive HTTP/1.1 404 Not Found
with following body:
{
  "detail": "Device with unique identifier 404 has not been found",
  "title": "Device not found",
  "described_by": "http://api.nfon.net/probs/device-not-found"
}
Missing Customer
Given I am authenticated as Admin
When I send /api/customers/K0404/devices/standard/00041323B577/site-options Then I should receive HTTP/1.1 404 Not Found
And Content-Type header should be application/api-problem+json
with following body:
{
  "title": "Customer not found",
  "detail": "Customer with identifier K0404 has not been found",
  "described_by": "http://api.nfon.net/probs/customer-not-found"
}
Customer should not be able to DELETE another Customer's Device Site Options
Given I am authenticated as Customer K0003
When I send /api/customers/K0002/devices/standard/00041323B577/site-options 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 [Customer] with id [K0002]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot access Device Site Options of Customer that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/devices/standard/00041323B577/site-options 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 Device Site Options of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/devices/standard/00041323B577/site-options 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"
}