Api >

Service Portal REST API

DELETE removes given Handset Device
Given I am authenticated as K0002
And there is a Base Device with MAC ABCDEF012345 and it has inactive Handset with port Port0
When I send /api/customers/K0002/devices/base/ABCDEF012345/handsets/Port0
Then I should receive HTTP/1.1 204 No Content
And there should be no Handset with port Port0 for ABCDEF012345 base device
DELETE validates if Handset Device can be deleted
Given I am authenticated as K0002
And there is a Base Device with MAC ABCDEF012345 and it has active Handset with port Port0
When I send /api/customers/K0002/devices/base/ABCDEF012345/handsets/Port0
Then I should receive HTTP/1.1 400 Bad Request with following body
{
  "errors": [{
    "message": "Cannot delete active device"
  }]
}
Cannot delete Handset for missing Customer
Given I am authenticated as Admin
When I send /api/customers/K0404/devices/base/ABCDEF012345/handsets/Port0
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"
}
Customer cannot DELETE other customer Handset Device
Given I am authenticated as K0003
And there is a Base Device with MAC ABCDEF012345 and it has active Handset with port Port0 and is owned by Customer K0002
When I send /api/customers/K0002/devices/base/ABCDEF012345/handsets/Port0
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 Handset of Customer that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/devices/base/ABCDEF012345/handsets/Port0
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 Handset of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/devices/base/ABCDEF012345/handsets/Port0
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"
}