Api >

Service Portal REST API

DELETE removes requested Time Control Service
Given I am authenticated as customer K0002
And there is a time control service
  • with name time control name
  • with service number 345
  • and asterisk extension number 576
When I send /api/customers/K0002/targets/time-control-services/345
Then I should receive HTTP/1.1 204 No Content
Then given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/time-control-services/345
Then I should receive HTTP/1.1 404 Not Found
Cannot remove a missing Time Control Service
Given I am authenticated as customer K0002
and there is no Time Control Service with 404 identifier When I send /api/customers/K0002/targets/time-control-services/404
Then I should receive HTTP/1.1 404 Not Found
{
  "title": "Time Control Service not found",
  "detail": "Time Control Service with service number 404 not found",
  "described_by": "http://api.nfon.net/probs/time-control-service-not-found"
}
Admin cannot remove a missing Customer's Time Control Service
Given I am authenticated as Admin
When I send /api/customers/K0404/targets/time-control-services/345
Then I should receive HTTP/1.1 404 Not Found
{
  "title": "Customer not found",
  "detail": "Customer with identifier K0404 has not been found",
  "described_by": "http://api.nfon.net/probs/customer-not-found"
}
Customer cannot remove another Customer's Time Control Service
Given there is a time control service with service number 345
and I am authenticated as Customer K0003
When I send /api/customers/K0002/targets/time-control-services/345
Then I should receive HTTP/1.1 403 Forbidden
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0002]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot remove another Time Control Service of Customer, that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/targets/time-control-services/345
Then I should receive HTTP/1.1 403 Forbidden
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Operator cannot remove another Time Control Service of Customer, that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/time-control-services/345
Then I should receive HTTP/1.1 403 Forbidden
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}