Api >

Service Portal REST API

PUT Deactivates Operator Panel
Given I am authenticated as K0002
And there is Operator Panel Device with Mac Address 01-23-45-67-89-ab
When I send /api/customers/K0002/devices/operator-panel/01-23-45-67-89-ab/activate using application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "active",
    "value": false
  }]
}
Then I should receive HTTP/1.1 204 No Content
And Operator Panel with macAddress 01-23-45-67-89-ab is deactivated
PUT Activates Operator Panel
Given I am authenticated as K0002
And there is inactive Operator Panel Device with Mac Address 01-23-45-67-89-ab
When I send /api/customers/K0002/devices/operator-panel/01-23-45-67-89-ab/activate using application/json; charset=UTF-8 with following body:
{
  "data": [{
    "name": "active",
    "value": true
  }]
}
Then I should receive HTTP/1.1 204 No Content
And Operator Panel with macAddress 01-23-45-67-89-ab is activated
PUT Doesn't allow to activate/deactivate non-existing Unprovisioned Sip device
Given I am authenticated as K0002
And there is no Unprovisioned Sip with id ABCDEF012345
When I send /api/customers/K0002/devices/unprovisioned-sip/ABCDEF012345/activate using application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "active",
    "value": true
  }]
}
Then I should receive HTTP/1.1 404 Not Found
{
  "title": "Device not found",
  "detail": "Device with unique identifier ABCDEF012345 has not been found",
  "described_by": "http://api.nfon.net/probs/device-not-found"
}
PUT Doesn't allow to activate/deactivate non-existing XCAPI device
Given I am authenticated as K0002
And there is no XCAPI device with id ABCDEF012345
When I send /api/customers/K0002/devices/xcapi/ABCDEF012345/activate using application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "active",
    "value": true
  }]
}
Then I should receive HTTP/1.1 404 Not Found
{
  "title": "Device not found",
  "detail": "Device with unique identifier ABCDEF012345 has not been found",
  "described_by": "http://api.nfon.net/probs/device-not-found"
}
PUT Doesn't allow to activate/deactivate non-existing Standard device
Given I am authenticated as K0002
And there is no Standard device with id ABCDEF012345
When I send /api/customers/K0002/devices/standard/ABCDEF012345/activate using application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "active",
    "value": true
  }]
}
Then I should receive HTTP/1.1 404 Not Found
{
  "title": "Device not found",
  "detail": "Device with unique identifier ABCDEF012345 has not been found",
  "described_by": "http://api.nfon.net/probs/device-not-found"
}
PUT Doesn't allow to activate/deactivate non-existing FMC device
Given I am authenticated as K0002
And there is no FMC device with id ABCDEF012345
When I send /api/customers/K0002/devices/fmc/ABCDEF012345/activate using application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "active",
    "value": true
  }]
}
Then I should receive HTTP/1.1 404 Not Found
{
  "title": "Device not found",
  "detail": "Device with unique identifier ABCDEF012345 has not been found",
  "described_by": "http://api.nfon.net/probs/device-not-found"
}
PUT Doesn't allow to activate/deactivate non-existing Base device
Given I am authenticated as K0002
And there is no Base Device with id ABCDEF012345
When I send /api/customers/K0002/devices/base/ABCDEF012345/activate using application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "active",
    "value": true
  }]
}
Then I should receive HTTP/1.1 404 Not Found
{
  "title": "Device not found",
  "detail": "Device with unique identifier ABCDEF012345 has not been found",
  "described_by": "http://api.nfon.net/probs/device-not-found"
}
PUT Doesn't allow to activate/deactivate non-existing Operator Panel
Given I am authenticated as K0002
And there is no Operator Panel with id 01-23-45-67-89-ab
When I send /api/customers/K0002/devices/operator-panel/01-23-45-67-89-ab/activate using application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "active",
    "value": true
  }]
}
Then I should receive HTTP/1.1 404 Not Found
{
  "title": "Device not found",
  "detail": "Device with unique identifier 01-23-45-67-89-ab has not been found",
  "described_by": "http://api.nfon.net/probs/device-not-found"
}
PUT Doesn't allow to activate/deactivate non-existing Media Gateway
Given I am authenticated as K0002
And there is no Media Gateway with id 123456789ABC
When I send /api/customers/K0002/devices/media-gateway/123456789ABC/activate using application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "active",
    "value": true
  }]
}
Then I should receive HTTP/1.1 404 Not Found
{
  "title": "Device not found",
  "detail": "Device with unique identifier 123456789ABC has not been found",
  "described_by": "http://api.nfon.net/probs/device-not-found"
}
PUT Doesn't allow to activate/deactivate device which belongs to other customer
Given I am authenticated as K0002
And there is Operator Panel Device with Mac Address 01-23-45-67-89-ab for Customer K0003
When I send /api/customers/K0002/devices/operator-panel/01-23-45-67-89-ab/activate using application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "active",
    "value": true
  }]
}
Then I should get HTTP/1.1 404 Not Found with body
{
  "title": "Device not found",
  "detail": "Device with unique identifier 01-23-45-67-89-ab has not been found",
  "described_by": "http://api.nfon.net/probs/device-not-found"
}
PUT doesn't allow to activate device if it will break Customer's Contract constraints
Given I am authenticated as K0003
And I have Operator Panel Device with Mac Address 01-23-45-67-89-ab and my Contract does not allow me to add more Devices
When I send /api/customers/K0003/devices/operator-panel/01-23-45-67-89-ab/activate using application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "active",
    "value": true
  }]
}
Then I should get HTTP/1.1 400 Bad Request with body
{
  "title": "Validation error",
  "detail": "Could not create or update resource due to constraint violations",
  "errors": [{
    "message": "Customer contract type does not allow to add more Devices"
  }],
  "described_by": "http://api.nfon.net/probs/validation-error"
}
PUT doesn't allow to activate device if it is of incorrect type
Given I am authenticated as K0002
And I have Operator Panel Device with Mac Address 01-23-45-67-89-ab When I send /api/customers/K0002/devices/base/01-23-45-67-89-ab/activate using application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "active",
    "value": true
  }]
}
Then I should get HTTP/1.1 404 Not Found with body
{
  "title": "Device not found",
  "detail": "Device with unique identifier 01-23-45-67-89-ab has not been found",
  "described_by": "http://api.nfon.net/probs/device-not-found"
}
PUT doesn't allow to activate device if it is of incorrect type
Given I am authenticated as K0002
And I have Operator Panel Device with Mac Address 01-23-45-67-89-ab When I send /api/customers/K0002/devices/not-existing-type/01-23-45-67-89-ab/activate using application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "active",
    "value": true
  }]
}
Then I should get HTTP/1.1 404 Not Found with body
{
  "title": "Device not found",
  "detail": "Device with unique identifier 01-23-45-67-89-ab has not been found",
  "described_by": "http://api.nfon.net/probs/device-not-found"
}
Admin cannot activate device for missing Customer
Given I am authenticated as Admin
and there is no Customer K0404 When I send /api/customers/K0404/devices/operator-panel/01-23-45-67-89-ab/activate using application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "active",
    "value": true
  }]
}
Then I should get HTTP/1.1 404 Not Found with 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 cannot activate device for another Customer
Given I have Operator Panel Device with Mac Address 01-23-45-67-89-ab and I am authenticated as Customer K0003
When I send /api/customers/K0002/devices/operator-panel/01-23-45-67-89-ab/activate using application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "active",
    "value": true
  }]
}
Then I should get HTTP/1.1 403 Forbidden with body
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0002]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot activate Device of Customer that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/devices/operator-panel/01-23-45-67-89-ab/activate
using application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "active",
    "value": true
  }]
}
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 activate Device of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/devices/operator-panel/01-23-45-67-89-ab/activate
using application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "active",
    "value": true
  }]
}
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"
}