Api >

Service Portal REST API

DELETE removes requested Standard Device
Given I am authenticated as customer K0002
and there is a deactivated Unprovisioned Sip Device with ID 123456789abc and with name unprovisioned_sip
When I send /api/customers/K0002/devices/unprovisioned-sip/123456789abc
Then I should receive HTTP/1.1 204 No Content
Given I am authenticated as customer K0002
When I send /api/customers/K0002/devices/unprovisioned-sip/123456789abc
Then I should receive HTTP/1.1 404 Not Found
Cannot DELETE Device for missing Customer
Given I am authenticated as Admin
When I send /api/customers/K0404/devices/unprovisioned-sip/123456789abc
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
  "described_by": "http://api.nfon.net/probs/customer-not-found",
  "title": "Customer not found",
  "detail": "Customer with identifier K0404 has not been found"
}
Cannot DELETE missing Device
Given I am authenticated as customer K0002
And there is no Unprovisioned Sip with id ABCDEF012345
When I send /api/customers/K0002/devices/unprovisioned-sip/ABCDEF012345
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
  "title": "Device not found",
  "detail": "Device with unique identifier ABCDEF012345 has not been found",
  "described_by": "http://api.nfon.net/probs/device-not-found"
}
Cannot DELETE active Device
Given I am authenticated as customer K0002
and there is a activated Unprovisioned Sip Device with ID 123456789abc and with name unprovisioned_sip
When I send /api/customers/K0002/devices/unprovisioned-sip/123456789abc
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Cannot delete active device"
  }]
}
Cannot DELETE Device of another Customer
Given there is a activated Unprovisioned Sip Device with ID 123456789abc and with name unprovisioned_sip
and I am authenticated as customer K0003
When I send /api/customers/K0002/devices/unprovisioned-sip/123456789012345
Then I should receive HTTP/1.1 403 Forbidden
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 delete Unprovisioned Sip Device of Customer that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/devices/unprovisioned-sip/123456789012345
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 delete Unprovisioned Sip Device of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/devices/unprovisioned-sip/123456789012345
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"
}