Api >
Service Portal REST API
Change Geographical properties
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"links": [{
"rel": "timezone",
"href": "/api/time-zones/Europe.Berlin"
}],
"data": [{
"name": "dialPrefix",
"value": "9"
}, {
"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/sites/a062000000HbAsd/site-options
Then I should receive
HTTP/1.1 200 OK
with following body
{
"links": [{
"rel": "timezone",
"href": "/api/time-zones/Europe.Berlin"
}],
"data": [{
"name": "dialPrefix",
"value": "9"
}, {
"name": "language",
"value": "en"
}]
}
Change Network properties
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"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": true
}]
}
Then I should receive
HTTP/1.1 204 No Content
Given I am
authenticated as Customer
K0002
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
Then I should receive
HTTP/1.1 200 OK
with following body
{
"data": [{
"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": true
}]
}
Change Monitoring properties
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "monitoringServer",
"value": "nfon.monitoring.server"
}, {
"name": "monitoringLevel",
"value": "Moderate"
}]
}
Then I should receive
HTTP/1.1 204 No Content
Given I am
authenticated as Customer
K0002
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
Then I should receive
HTTP/1.1 200 OK
with following body
{
"data": [{
"name": "monitoringServer",
"value": "nfon.monitoring.server"
}, {
"name": "monitoringLevel",
"value": "Moderate"
}]
}
And monitoringUntil
is set to 30 days from now.
Change Codec Profile
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "codecProfile",
"value": "Standard-Codec (G711)"
}]
}
Then I should receive
HTTP/1.1 204 No Content
Given I am
authenticated as Customer
K0002
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
Then I should receive
HTTP/1.1 200 OK
with following body
{
"data": [{
"name": "codecProfile",
"value": "Standard-Codec (G711)"
}]
}
Change uaCSTA properties
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "uacstaActive",
"value": true
}, {
"name": "uacstaServer",
"value": "nfon.uacsta.server"
}, {
"name": "uacstaPort",
"value": 1000
}, {
"name": "uacstaProtocol",
"value": "UDP"
}, {
"name": "uacstaPassword",
"value": "password"
}]
}
Then I should receive
HTTP/1.1 204 No Content
Given I am
authenticated as Customer
K0002
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
Then I should receive
HTTP/1.1 200 OK
with following body
{
"data": [{
"name": "uacstaActive",
"value": true
}, {
"name": "uacstaServer",
"value": "nfon.uacsta.server"
}, {
"name": "uacstaPort",
"value": 1000
}, {
"name": "uacstaProtocol",
"value": "UDP"
}]
}
And uacstaPassword equals
password
Change LDAP properties
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
And Operator
C0002 allows to change LDAP properties
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "ldapActive",
"value": true
}, {
"name": "ldapServer",
"value": "nfon.ldap.server"
}, {
"name": "ldapPort",
"value": 1001
}, {
"name": "ldapUsername",
"value": "username"
}, {
"name": "ldapPassword",
"value": "password"
}]
}
Then I should receive
HTTP/1.1 204 No Content
Given I am
authenticated as Customer
K0002
And Operator
C0002 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
{
"data": [{
"name": "ldapActive",
"value": true
}, {
"name": "ldapServer",
"value": "nfon.ldap.server"
}, {
"name": "ldapPort",
"value": 1001
}, {
"name": "ldapUsername",
"value": "username"
}]
}
And ldapPassword equals
password
Operator can change SIP properties
Given I am
authenticated as Operator
C0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "canReinvite",
"value": true
}, {
"name": "nat",
"value": true
}, {
"name": "sipTransport",
"value": "UDP"
}]
}
Then I should receive
HTTP/1.1 204 No Content
Given I am
authenticated as Customer
K0002
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
Then I should receive
HTTP/1.1 200 OK
with following body
{
"data": [{
"name": "canReinvite",
"value": true
}, {
"name": "nat",
"value": true
}]
}
Customer or System Integrator cannot change canReinvite
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "canReinvite",
"value": true
}]
}
Then I should receive
HTTP/1.1 403 Forbidden
with following body
{
"detail": "Required role is missing to access field 'canReinvite'",
"described_by": "http://api.nfon.net/probs/field-access-error"
}
Customer or System Integrator cannot change nat
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "nat",
"value": true
}]
}
Then I should receive
HTTP/1.1 403 Forbidden
with following body
{
"detail": "Required role is missing to access field 'nat'",
"described_by": "http://api.nfon.net/probs/field-access-error"
}
Cannot change vlanTagging for Mobile site
Given I am
authenticated as Customer
K0002
When I send
/api/customers/K0002/sites/1/site-options
with
and body
{
"data": [{
"name": "vlanTagging",
"value": true
}, {
"name": "voiceVlan",
"value": 10
}, {
"name": "dataVlan",
"value": 10
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "Field not available for Mobile Site",
"path": "vlanTagging",
"value": true
}]
}
Cannot change voiceVlan if vlanTagging is not active
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "vlanTagging",
"value": false
}, {
"name": "voiceVlan",
"value": 10
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "Cannot set voiceVlan if vlanTagging is false",
"path": "voiceVlan"
}]
}
Cannot change dataVlan if vlanTagging is not active
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "vlanTagging",
"value": false
}, {
"name": "dataVlan",
"value": 10
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "Cannot set dataVlan if vlanTagging is false",
"path": "dataVlan"
}]
}
Cannot change voiceVlan with invalid value
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "vlanTagging",
"value": true
}, {
"name": "voiceVlan",
"value": -1
}, {
"name": "dataVlan",
"value": 10
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "must be greater than or equal to 0",
"path": "voiceVlan",
"value": "-1"
}]
}
Cannot change dataVlan with invalid value
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "vlanTagging",
"value": true
}, {
"name": "dataVlan",
"value": 999999999
}, {
"name": "voiceVlan",
"value": 10
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "must be less than or equal to 65535",
"path": "dataVlan",
"value": "999999999"
}]
}
Cannot change VLAN without all required properties if vlanTagging is true
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "vlanTagging",
"value": true
}, {
"name": "dataVlan",
"value": null
}, {
"name": "voiceVlan",
"value": null
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "voiceVlan is required when enabling VLAN Tagging",
"path": "voiceVlan"
}, {
"message": "dataVlan is required when enabling VLAN Tagging",
"path": "dataVlan"
}]
}
Cannot Change Site Options with invalid dialPrefix
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "dialPrefix",
"value": "55"
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "Invalid value for dialPrefix, expected 0 or 9",
"path": "dialPrefix",
"value": "55"
}]
}
Cannot Change Site Options with invalid language
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "language",
"value": "INVALID"
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"path": "language",
"value": "INVALID"
}]
}
Cannot Change Site Options with invalid portSpeed
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "portSpeed",
"value": "INVALID"
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"path": "portSpeed",
"value": "INVALID"
}]
}
Cannot Change Site Options with invalid monitoringLevel
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "monitoringLevel",
"value": "invalid"
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "Invalid monitoringLevel value",
"path": "monitoringLevel",
"value": "invalid"
}]
}
Cannot Change Site Options with invalid codecProfile
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "codecProfile",
"value": "invalid"
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "Invalid codecProfile value",
"path": "codecProfile",
"value": "invalid"
}]
}
Cannot Change uacstaServer if not activated
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "uacstaActive",
"value": false
}, {
"name": "uacstaServer",
"value": "nfon.uacsta.server"
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "Cannot set uacstaServer if uaCSTA is not activated",
"path": "uacstaServer"
}]
}
Cannot Change uacstaPort if not activated
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "uacstaActive",
"value": false
}, {
"name": "uacstaPort",
"value": 1000
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "Cannot set uacstaPort if uaCSTA is not activated",
"path": "uacstaPort"
}]
}
Cannot Change uacstaProtocol if not activated
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "uacstaActive",
"value": false
}, {
"name": "uacstaProtocol",
"value": "UDP"
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "Cannot set uacstaProtocol if uaCSTA is not activated",
"path": "uacstaProtocol"
}]
}
Cannot Change uacstaPassword if not activated
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "uacstaActive",
"value": false
}, {
"name": "uacstaPassword",
"value": "password"
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "Cannot set uacstaPassword if uaCSTA is not activated",
"path": "uacstaPassword"
}]
}
Cannot Change Site Options if not all uaCSTA properties are set when activated
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "uacstaActive",
"value": true
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "uacstaServer is required when uaCSTA is active",
"path": "uacstaServer"
}, {
"message": "uacstaPort is required when uaCSTA is active",
"path": "uacstaPort"
}, {
"message": "uacstaProtocol is required when uaCSTA is active",
"path": "uacstaProtocol"
}, {
"message": "uacstaPassword is required when uaCSTA is active",
"path": "uacstaPassword"
}]
}
Cannot Change Site Options if uacstaServer is empty
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
And it
has following Site Options:
- uacstaActive: true
- uacstaServer: nfon.uacsta.server
- uacstaPort: 1001
- uacstaProtocol: UDP
- uacstaPassword: password
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "uacstaServer",
"value": ""
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "uacstaServer has to be not blank",
"path": "uacstaServer"
}]
}
Cannot Change Site Options if uacstaProtocol has invalid value
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
And it
has following Site Options:
- uacstaActive: true
- uacstaServer: nfon.uacsta.server
- uacstaPort: 1001
- uacstaProtocol: UDP
- uacstaPassword: password
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "uacstaProtocol",
"value": "INVALID"
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"path": "uacstaProtocol",
"value": "INVALID"
}]
}
Cannot Change ldapServer if not activated
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
And Operator
C0002 allows to change LDAP properties
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "ldapActive",
"value": false
}, {
"name": "ldapServer",
"value": "nfon.ldap.server"
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "Cannot set ldapServer if LDAP is not activated",
"path": "ldapServer"
}]
}
Cannot Change ldapPort if not activated
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
And Operator
C0002 allows to change LDAP properties
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "ldapActive",
"value": false
}, {
"name": "ldapPort",
"value": 1000
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "Cannot set ldapPort if LDAP is not activated",
"path": "ldapPort"
}]
}
Cannot Change ldapUsername if not activated
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
And Operator
C0002 allows to change LDAP properties
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "ldapActive",
"value": false
}, {
"name": "ldapUsername",
"value": "username"
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "Cannot set ldapUsername if LDAP is not activated",
"path": "ldapUsername"
}]
}
Cannot Change ldapPassword if not activated
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
And Operator
C0002 allows to change LDAP properties
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "ldapActive",
"value": false
}, {
"name": "ldapPassword",
"value": "password"
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "Cannot set ldapPassword if LDAP is not activated",
"path": "ldapPassword"
}]
}
Cannot Change Site Options if not all LDAP properties are set when activated
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
And Operator
C0002 allows to change LDAP properties
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "ldapActive",
"value": true
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "ldapServer is required when LDAP is active",
"path": "ldapServer"
}, {
"message": "ldapPort is required when LDAP is active",
"path": "ldapPort"
}, {
"message": "ldapUsername is required when LDAP is active",
"path": "ldapUsername"
}, {
"message": "ldapPassword is required when LDAP is active",
"path": "ldapPassword"
}]
}
Cannot Change Site Options if ldapServer is empty
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
And it
has following Site Options:
- ldapActive: true
- ldapServer: nfon.ldap.server
- ldapPort: 1001
- ldapUsername: username
- ldapPassword: password
And Operator
C0002 allows to change LDAP properties
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "ldapServer",
"value": ""
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "ldapServer has to be not blank",
"path": "ldapServer"
}]
}
Cannot Change Site Options if ldapPort has invalid value
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
And it
has following Site Options:
- ldapActive: true
- ldapServer: nfon.ldap.server
- ldapPort: 1001
- ldapUsername: username
- ldapPassword: password
And Operator
C0002 allows to change LDAP properties
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "ldapPort",
"value": -10
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "must be greater than or equal to 1",
"path": "ldapPort",
"value": "-10"
}]
}
Cannot Change ldapActive 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 change LDAP properties
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "ldapActive",
"value": true
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "Operator does not allow to change ldapActive property",
"path": "ldapActive"
}]
}
Cannot Change ldapServer if it is not allowed by Operator
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
And it
has following Site Options:
- ldapActive: true
- ldapServer: nfon.ldap.server
- ldapPort: 1001
- ldapUsername: username
- ldapPassword: password
And Operator
C0002 does
not allows to change LDAP properties
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "ldapServer",
"value": "nfon.ldap.server.new"
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "Operator does not allow to change ldapServer property",
"path": "ldapServer"
}]
}
Cannot Change ldapPort if it is not allowed by Operator
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
And it
has following Site Options:
- ldapActive: true
- ldapServer: nfon.ldap.server
- ldapPort: 1001
- ldapUsername: username
- ldapPassword: password
And Operator
C0002 does
not allows to change LDAP properties
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "ldapPort",
"value": 1002
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "Operator does not allow to change ldapPort property",
"path": "ldapPort"
}]
}
Cannot Change ldapUsername if it is not allowed by Operator
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
And it
has following Site Options:
- ldapActive: true
- ldapServer: nfon.ldap.server
- ldapPort: 1001
- ldapUsername: username
- ldapPassword: password
And Operator
C0002 does
not allows to change LDAP properties
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "ldapUsername",
"value": "new username"
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "Operator does not allow to change ldapUsername property",
"path": "ldapUsername"
}]
}
Cannot Change ldapPassword if it is not allowed by Operator
Given I am
authenticated as Customer
K0002
And
there is a Site with salesforceId
a062000000HbAsd
And it
has following Site Options:
- ldapActive: true
- ldapServer: nfon.ldap.server
- ldapPort: 1001
- ldapUsername: username
- ldapPassword: password
And Operator
C0002 does
not allows to change LDAP properties
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "ldapPassword",
"value": "newPassword"
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "Operator does not allow to change ldapPassword property",
"path": "ldapPassword"
}]
}
Admin can change LDAP properties regardless of Operator settings
Given I am
authenticated as
Admin
And
there is a Site with salesforceId
a062000000HbAsd
And Operator
C0002 does
not allows to change LDAP properties
When I send
/api/customers/K0002/sites/a062000000HbAsd/site-options
with
and body
{
"data": [{
"name": "ldapActive",
"value": true
}, {
"name": "ldapServer",
"value": "nfon.net"
}, {
"name": "ldapPort",
"value": 1000
}, {
"name": "ldapUsername",
"value": "username"
}, {
"name": "ldapPassword",
"value": "password"
}]
}
Then I should receive
HTTP/1.1 204 No Content
Missing Site
Given I am
authenticated as Customer
K0002
When I send
/api/customers/K0002/sites/404/site-options
with
and body
{}
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
with
and body
{}
Then I should receive
HTTP/1.1 404 Not Found
And Content-Type header should be
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
with
and body
{}
Then I should receive
HTTP/1.1 403 Forbidden
And Content-Type header should be
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
with
and body
{}
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
with
and body
{}
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"
}