Api >

Service Portal REST API

GET Site Options
Given I am authenticated as Customer K0002
And there is a Site with salesforceId a062000000HbAsd
And it has following Site Options:
  • dialPrefix: 9
  • language: en
  • language: 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
When I send /api/customers/K0002/sites/a062000000HbAsd/site-options
Then I should receive HTTP/1.1 200 OK
with following body
{
  "href": "/api/customers/K0002/sites/a062000000HbAsd/site-options",
  "links": [{
    "rel": "timezone",
    "href": "INHERIT"
  }],
  "data": [{
    "name": "dialPrefix",
    "value": "9"
  }, {
    "name": "language",
    "value": "en"
  }, {
    "name": "publicSpace",
    "value": false
  }, {
    "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 Site with salesforceId a062000000HbAsd
And Operator C0002 does not allows to show LDAP properties
When I send /api/customers/K0002/sites/a062000000HbAsd/site-options
Then I should receive HTTP/1.1 200 OK
and response should not contain:
  • ldapActive property
  • ldapServer property
  • ldapPort property
  • ldapUsername property
Missing Site
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/sites/404/site-options
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
  "detail": "Site [404] not found for Customer [K0002]",
  "title": "Site [404] not found for Customer [K0002]",
  "described_by": "http://api.nfon.net/probs/site-not-found"
}
Missing Customer
Given I am authenticated as Admin
When I send /api/customers/K0404/sites/a062000000HbAsd/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/sites/a062000000HbAsd/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/sites/a062000000HbAsd/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/sites/a062000000HbAsd/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"
}