Api >
Service Portal REST API
Change Geographical properties
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
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/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
When I send
/api/customers/K0002/devices/standard/00041323B577/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/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
When I send
/api/customers/K0002/devices/standard/00041323B577/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/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
When I send
/api/customers/K0002/devices/standard/00041323B577/site-options
with
and body
{
"data": [{
"name": "codecProfile",
"value": "HD-Codec (G722, Fallback=G711)"
}]
}
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
{
"data": [{
"name": "codecProfile",
"value": "HD-Codec (G722, Fallback=G711)"
}]
}
Change uaCSTA properties
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
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/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
And Operator
C0002 allows to change LDAP properties
And Device
has LDAP Provisioning allowed.
When I send
/api/customers/K0002/devices/standard/00041323B577/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
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
{
"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 Standard Device
with ID
00041323B577
of type
type01
When I send
/api/customers/K0002/devices/standard/00041323B577/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/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
When I send
/api/customers/K0002/devices/standard/00041323B577/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 voiceVlan if vlanTagging is not active
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
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 Standard Device
with ID
00041323B577
of type
type01
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
When I send
/api/customers/K0002/devices/standard/00041323B577/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 dataVlan to null
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
and body
{
"data": [{
"name": "vlanTagging",
"value": true
}, {
"name": "dataVlan",
"value": null
}]
}
Then I should receive
HTTP/1.1 400 Bad Request
with following body
{
"errors": [{
"message": "dataVlan is required when enabling VLAN Tagging",
"path": "dataVlan"
}]
}
Cannot change vioceVlan to null
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
and body
{
"data": [{
"name": "vlanTagging",
"value": true
}, {
"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"
}]
}
Cannot Change Site Options with invalid dialPrefix
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
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 Standard Device
with ID
00041323B577
of type
type01
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
And it
has following Site Options:
- uacstaActive: true
- uacstaServer: nfon.uacsta.server
- uacstaPort: 1001
- uacstaProtocol: UDP
- uacstaPassword: password
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
And it
has following Site Options:
- uacstaActive: true
- uacstaServer: nfon.uacsta.server
- uacstaPort: 1001
- uacstaProtocol: UDP
- uacstaPassword: password
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
And Operator
C0002 allows to change LDAP properties
And Device
has LDAP Provisioning allowed.
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
And Operator
C0002 allows to change LDAP properties
And Device
has LDAP Provisioning allowed.
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
And Operator
C0002 allows to change LDAP properties
And Device
has LDAP Provisioning allowed.
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
And Operator
C0002 allows to change LDAP properties
And Device
has LDAP Provisioning allowed.
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
And Operator
C0002 allows to change LDAP properties
And Device
has LDAP Provisioning allowed.
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
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
And Device
has LDAP Provisioning allowed.
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
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
And Device
has LDAP Provisioning allowed.
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
And Operator
C0002 does
not allows to change LDAP properties
And Device
has LDAP Provisioning allowed.
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
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
And Device
has LDAP Provisioning allowed.
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
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
And Device
has LDAP Provisioning allowed.
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
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
And Device
has LDAP Provisioning allowed.
When I send
/api/customers/K0002/devices/standard/00041323B577/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 Standard Device
with ID
00041323B577
of type
type01
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
And Device
has LDAP Provisioning allowed.
When I send
/api/customers/K0002/devices/standard/00041323B577/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"
}]
}
Cannot Change LDAP properties if LDAP Provisioning is not allowed for Device
Given I am
authenticated as Customer
K0002
and
there is a Standard Device
with ID
00041323B577
of type
type01
And Operator
C0002 allows to change LDAP properties
And Device does
not have LDAP Provisioning allowed.
When I send
/api/customers/K0002/devices/standard/00041323B577/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 400 Bad Request
with following body
{
"errors": [{
"message": "Device settings for LDAP Provisioning do not allow to change ldapActive",
"path": "ldapActive"
}, {
"message": "Device settings for LDAP Provisioning do not allow to change ldapServer",
"path": "ldapServer"
}, {
"message": "Device settings for LDAP Provisioning do not allow to change ldapPort",
"path": "ldapPort"
}, {
"message": "Device settings for LDAP Provisioning do not allow to change ldapUsername",
"path": "ldapUsername"
}, {
"message": "Device settings for LDAP Provisioning do not allow to change ldapPassword",
"path": "ldapPassword"
}]
}
Admin can change LDAP properties regardless of Operator settings
Given I am
authenticated as
Admin
and
there is a Standard Device
with ID
00041323B577
of type
type01
And Operator
C0002 does
not allows to change LDAP properties
And Device does
not have LDAP Provisioning allowed.
When I send
/api/customers/K0002/devices/standard/00041323B577/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
Should not allow to change Site Options for Device of Type FMC
Given I am
authenticated as Customer
K0002
When I send
/api/customers/K0002/devices/fmc/00041323B577/site-options
with
and body
{}
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 allow to change 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
with
and body
{}
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 allow to change 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
with
and body
{}
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 allow to change 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
with
and body
{}
Then I should receive
HTTP/1.1 204 No Content
Should allow to change 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
and body
{}
Then I should receive
HTTP/1.1 204 No Content
Should allow to change 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
and body
{}
Then I should receive
HTTP/1.1 204 No Content
Should allow to change 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
and body
{}
Then I should receive
HTTP/1.1 204 No Content
Should allow to change 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
and body
{}
Then I should receive
HTTP/1.1 204 No Content
Should change useSiteOptionsFromSite on Device when sending PUT for the first time
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
and body
{}
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
Then I should receive
HTTP/1.1 200 OK
with following body
{
"data": [{
"name": "useSiteOptionsFromSite",
"value": false
}]
}
Should not override SiteOptions of Site when changing Device's Site Options for the first time
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
and body
{}
Then I should receive
HTTP/1.1 204 No Content
And Device should
have different Site Options than Site
Missing Device
Given I am
authenticated as Customer
K0002
When I send
/api/customers/K0002/devices/standard/404/site-options
with
and body
{}
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
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 Device Site Options
Given I am
authenticated as Customer
K0003
When I send
/api/customers/K0002/devices/standard/00041323B577/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 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
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 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
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"
}