Api >

Service Portal REST API

GET Site Options
Given I am authenticated as Customer K0002
and there is a Standard Device with ID 00041323B577 of type type01
And it has following Site Options:
  • dialPrefix: 9
  • language: en
  • publicSpace: false
  • canReinvite: true
  • nat: false
  • sipTransport: INHERIT
  • vlanTagging: true
  • voiceVlan: 5
  • dataVlan: 6
  • portSpeed: FULL_100M
  • ntpServer: nfon.ntp.server
  • autoHotDesking: false
  • monitoringServer: nfon.monitoring.server
  • monitoringLevel: Minimal
  • monitoringUntil: 2015-10-13
  • codecProfile: Standard-Codec (G711)
  • uacstaActive: true
  • uacstaServer: nfon.uacsta.server
  • uacstaPort: 1000
  • uacstaProtocol: UDP
  • ldapActive: true
  • ldapServer: nfon.ldap.server
  • ldapPort: 1001
  • ldapUsername: username
And Operator C0002 does allows to show LDAP properties
And Device has LDAP Provisioning allowed.
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",
  "links": [{
    "rel": "timezone",
    "href": "INHERIT"
  }],
  "data": [{
    "name": "dialPrefix",
    "value": "9"
  }, {
    "name": "language",
    "value": "en"
  }, {
    "name": "canReinvite",
    "value": true
  }, {
    "name": "nat",
    "value": false
  }, {
    "name": "sipTransport",
    "value": "INHERIT"
  }, {
    "name": "vlanTagging",
    "value": true
  }, {
    "name": "voiceVlan",
    "value": 5
  }, {
    "name": "dataVlan",
    "value": 6
  }, {
    "name": "portSpeed",
    "value": "FULL_100M"
  }, {
    "name": "ntpServer",
    "value": "nfon.ntp.server"
  }, {
    "name": "autoHotDesking",
    "value": false
  }, {
    "name": "monitoringServer",
    "value": "nfon.monitoring.server"
  }, {
    "name": "monitoringLevel",
    "value": "Minimal"
  }, {
    "name": "monitoringUntil",
    "value": "2015-10-13"
  }, {
    "name": "codecProfile",
    "value": "Standard-Codec (G711)"
  }, {
    "name": "uacstaActive",
    "value": true
  }, {
    "name": "uacstaServer",
    "value": "nfon.uacsta.server"
  }, {
    "name": "uacstaPort",
    "value": 1000
  }, {
    "name": "uacstaProtocol",
    "value": "UDP"
  }, {
    "name": "ldapActive",
    "value": true
  }, {
    "name": "ldapServer",
    "value": "nfon.ldap.server"
  }, {
    "name": "ldapPort",
    "value": 1001
  }, {
    "name": "ldapUsername",
    "value": "username"
  }]
}
Customer, Operator nad System Integrator should not see LDAP properties if it is not allowed by Operator
Given I am authenticated as Customer K0002
and there is a Standard Device with ID 00041323B577 of type type01
And Operator C0002 does not allows to show LDAP properties
When I send /api/customers/K0002/devices/standard/00041323B577/site-options
Then I should receive HTTP/1.1 200 OK
and response should not contain:
  • ldapActive property
  • ldapServer property
  • ldapPort property
  • ldapUsername property
Customer, Operator nad System Integrator should not see LDAP properties if Device does not have LDAP Provisioning set
Given I am authenticated as Customer K0002
and there is a Standard Device with ID 00041323B577 of type type01
And Operator C0002 allows to show LDAP properties
And Device does not have LDAP Provisioning allowed.
When I send /api/customers/K0002/devices/standard/00041323B577/site-options
Then I should receive HTTP/1.1 200 OK
and response should not contain:
  • ldapActive property
  • ldapServer property
  • ldapPort property
  • ldapUsername property
Should not return 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 return 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 return 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/softphone/device123/site-options
Then I should receive HTTP/1.1 200 OK
Should return 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
Then I should receive HTTP/1.1 200 OK
Should return 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
Then I should receive HTTP/1.1 200 OK
Should return 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
Then I should receive HTTP/1.1 200 OK
Should return 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
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
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 GET another Customer's Sites
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 Sites 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 Sites 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"
}