Api >

Service Portal REST API

DELETE removes existing Group Service
Given I am authenticated as Customer K0002
And there is a Group Service with service number 345
When I send /api/customers/K0002/targets/group-services/345
Then I should receive HTTP/1.1 204 No Content
And there should be no group service with service number 345
Cannot remove missing Group Service
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/targets/group-services/404
Then I should receive HTTP/1.1 404 Not Found
with following body
{
  "title": "Group not found",
  "detail": "Group with serviceNumber 404 not found",
  "described_by": "http://api.nfon.net/probs/group-not-found"
}
Admin cannot remove Group Service of missing Customer
Given I am authenticated as Admin
When I send /api/customers/K0404/targets/group-services/345
Then I should receive HTTP/1.1 404 Not Found
with following body
{
  "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 Group Service of another Customer
Given there is a Group Service with service number 345
and I am authenticated as Customer K0003
When I send /api/customers/K0002/targets/group-services/345
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 remove Group Service of Customer that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/targets/group-services/345
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 Group Service of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/group-services/345
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"
}