Api >

Service Portal REST API

DELETE removes Function Key
Given I am authenticated as Customer K0002
And there is PhoneExtension with extensionNumber 201
Which has assigned key with number 1
When I send /api/customers/K0002/targets/phone-extensions/201/function-keys/1
Then response code should be equal HTTP/1.1 204 No Content
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/targets/phone-extensions/201/function-keys/1
Then response code should be equal HTTP/1.1 404 Not Found
Missing Customer
Given I am authenticated as Admin
And there is no customer K404
When I send /api/customers/K404/targets/phone-extensions/1/function-keys/1
Then response code should be equal HTTP/1.1 404 Not Found
And response should look like:
{
  "described_by": "http://api.nfon.net/probs/customer-not-found",
  "title": "Customer not found",
  "detail": "Customer with identifier K404 has not been found"
}
Missing Extension
Given I am authenticated as Customer K0002
And there is no Phone Extension 404
When I send /api/customers/K0002/targets/phone-extensions/404/function-keys/1
Then response code should be equalHTTP/1.1 404 Not Found And response should look like:
{
  "described_by": "http://api.nfon.net/probs/extension-not-found",
  "title": "Extension not found",
  "detail": "Extension with extension number 404 has not been found"
}
Missing Function Key assignment
Given I am authenticated as Customer K0002
And there is PhoneExtension with extensionNumber 201
Which does not have function key 404 assigned
When I send /api/customers/K0002/targets/phone-extensions/201/function-keys/404
Then response code should be equal HTTP/1.1 404 Not Found And response should look like:
{
  "described_by": "http://api.nfon.net/probs/function-key-assignment-not-found",
  "title": "Function Key assignment not found",
  "detail": "Extension 201 does not have any assignment for key 404"
}
Customer cannot remove other Customer's Function Key Assignment
Given I am authenticated as Customer K0003
and there is PhoneExtension with extensionNumber 201
and assigned Key with id 1 to Phone extension When I send /api/customers/K0002/targets/phone-extensions/201/function-keys/1
Then I should get 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 Function Key of Customer that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/targets/phone-extensions/201/function-keys/1
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 Function Key of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/phone-extensions/201/function-keys/1
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"
}