Api >

Service Portal REST API

Should delete an IVR Service
Given I am authenticated as Customer K0002
And there is an IVR Service with service number 123
When I delete resource with /api/customers/K0002/targets/ivr-services/123 Then the response code should be equal HTTP/1.1 204 No Content
And the response should be no more IVR Service 123
Customer cannot delete IVR Service referenced by Frontdesk Service
Given I am authenticated as customer K0002
And there is an IVR Service with service number 555
And also there is a frontdesk service with a fallback target to this Queue Service
When I delete resource with /api/customers/K0002/targets/ivr-services/555 Then the response code should be equal HTTP/1.1 400 Bad Request
And the response should be
{
  "detail": "IVR Service[555] is still referenced as a Fallback target on Frontdesk Service: displayName[123]",
  "title": "Deletion of service/phone extension failed",
  "described_by": "http://api.nfon.net/probs/method-not-allowed"
}
Missing Customer
Given I am authenticated as Admin
And there is an IVR Service with service number 123
When I delete resource with /api/customers/K404/targets/ivr-services/123 Then the response code should be equal HTTP/1.1 404 Not Found
And the response should be
{
  "title": "Customer not found",
  "detail": "Customer with identifier K404 has not been found",
  "described_by": "http://api.nfon.net/probs/customer-not-found"
}
Customer can't remove resource which belongs to another customer
Given I am authenticated as customer K0002
And there is an IVR Service with service number 123
When I send /api/customers/K0003/targets/ivr-services/123
Then the response code should be equal HTTP/1.1 403 Forbidden
And the response should be
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot remove IVR Service of Customer, that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/targets/ivr-services/123
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 IVR Service of Customer, that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/ivr-services/123
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"
}