Api >

Service Portal REST API

DELETE removes Routing Prefix Extension
Given I am authenticated as customer K0002
and there is a Routing Prefix Extension with extension number 17
When I send /api/customers/K0002/targets/routing-prefix/17
Then I should receive HTTP/1.1 204 No Content
And authenticated call to /api/customers/K0002/targets/routing-prefix/17 returns HTTP/1.1 404 Not Found
DELETE returns 404 for missing Routing Prefix Extension
Given I am authenticated as customer K0002
and there is no Routing Prefix Extension with extension number 404
When I send /api/customers/K0002/targets/routing-prefix/404
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
  "detail": "routing prefix extension with extension number 404 has not been found",
  "title": "Routing prefix extension not found",
  "described_by": "http://api.nfon.net/probs/extension-not-found"
}
DELETE returns 403 if Customer tries to access another Customer's Routing Prefix Extension
Given I am authenticated as K0003
and there is a Routing Prefix Extension with extension number 17 assigned to K0002
When I send /api/customers/K0002/targets/routing-prefix/17
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"
}
Missing customer
Given I am authenticated as admin
When I send /api/customers/K404/targets/routing-prefix/17
Then I should get HTTP/1.1 404 Not Found
{
  "title": "Customer not found",
  "detail": "Customer with identifier K404 has not been found",
  "described_by": "http://api.nfon.net/probs/customer-not-found"
}
System Integrator cannot remove Routing Prefix Extension of Customer that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/targets/routing-prefix/17
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 remove Routing Prefix Extension of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/routing-prefix/17
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"
}