Api >

Service Portal REST API

Remove not managed Router
Given I am authenticated as System Integrator S0002
and next router id is 700
and there is a Managed Router with hostname router01.nfon.net
When I send /api/customers/K0002/routers/700
Then I should receive HTTP/1.1 204 No Content
and there should be no Router with ID 700
Cannot remove managed Router
Given I am authenticated as System Integrator S0002
and next router id is 700
and there is a Not Managed Router with hostname router01.nfon.net
When I send /api/customers/K0002/routers/700
Then I should receive HTTP/1.1 403 Forbidden
And Content-Type header should be application/api-problem+json
with following body:
{
  "title": "Managed routers cannot be deleted",
  "detail": "Router with ID 700 is managed, therefore cannot be deleted via API call",
  "described_by": "http://api.nfon.net/probs/cannot-delete-non-managed-router"
}
Customer can't remove routers
Given I am authenticated as customer K0002
and next router id is 700
and there is a Managed Router with hostname router01.nfon.net
When I ask for a router /api/customers/K0002/routers/700
Then I should receive HTTP/1.1 403 Forbidden
And Content-Type header should be application/api-problem+json
with following body:
{
  "title": "Access forbidden",
  "detail": "Required role is missing",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Missing Customer
Given I am authenticated as Admin
When I try to remove router for a customer that does not exist /api/customers/K404/routers/700
Then I should receive HTTP/1.1 404 Not Found
And Content-Type header should be application/api-problem+json
with following body:
{
  "title": "Customer not found",
  "detail": "Customer with identifier K404 has not been found",
  "described_by": "http://api.nfon.net/probs/customer-not-found"
}
Missing Router
Given I am authenticated as System Integrator S0002
When I try remove not existing router for a customer /api/customers/K0002/routers/404
Then I should receive HTTP/1.1 404 Not Found
And Content-Type header should be application/api-problem+json
with following body:
{
  "title": "Router not found",
  "detail": "Router with ID 404 has not been found",
  "described_by": "http://api.nfon.net/probs/router-not-found"
}
System Integrator cannot remove Router of Customer that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/routers/700
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 Router of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/routers/700
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"
}