Api >

Service Portal REST API

DELETE removes requested External Line Device
Given I am authenticated as customer K0002
and there is a deactivated External Line device with ID device123 and an associatedMobilePhoneNumber +01232456789
deactivated External Line Device with ID 123456789abc
When I send /api/customers/K0002/devices/external-line/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/external-line/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/external-line/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 some standard device with id ABCDEF012345
that cannot be deleted via external-line When I send /api/customers/K0002/devices/external-line/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 an active External Line device with ID 123456789abc and an associatedMobilePhoneNumber +01232456789
When I send /api/customers/K0002/devices/external-line/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 deactivated an deactived External Line device with ID 123456789abc and an associatedMobilePhoneNumber +01232456789
and I am authenticated as customer K0003
When I send /api/customers/K0002/devices/external-line/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 External Line device of Customer that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/devices/external-line/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 External Line device of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/devices/external-line/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"
}