Api >

Service Portal REST API

Admin can remove Lync Site
Given I am authenticated as Admin
and there is a LyncSite with id 500 and name Lync Site
When I send /api/customers/K0002/lync/sites/500
Then I should receive HTTP/1.1 204 No Content
and there should be no Lync Site with id 500
Used Lync Site cannot be removed
Given I am authenticated as Admin
and there is a LyncSite with id 500 and name Lync Site
and there is a Phone Extension with extension number 201
and display name PhoneExtension
which has Inbound Trunk Number +48 (22) 1111-119
which this Lync Site is assigned to
When I send /api/customers/K0002/lync/sites/500
Then I should receive HTTP/1.1 403 Forbidden
And Content-Type header should be application/api-problem+json
with following body:
{
  "title": "Forbidden operation",
  "detail": "Lync Site with id [500] could not be deleted due to being used in extensions",
  "described_by": "http://api.nfon.net/probs/forbidden-error"
}
Customer cannot remove Lync Site
Given I am authenticated as customer K0002
and there is a LyncSite with id 500 and name Lync Site
When I send /api/customers/K0002/lync/sites/500
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"
}
Cannot remove not existing Lync Site
Given I am authenticated as Admin
When I send /api/customers/K0002/lync/sites/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": "Lync Site not found",
  "detail": "Lync Site with id 404 not found",
  "described_by": "http://api.nfon.net/probs/lync-site-not-found"
}
Cannot remove Lync Site from not existing Customer
Given I am authenticated as Admin
and there is a LyncSite with id 500 and name Lync Site
When I send /api/customers/K0404/lync/sites/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": "Customer not found",
  "detail": "Customer with identifier K0404 has not been found",
  "described_by": "http://api.nfon.net/probs/customer-not-found"
}
System Integrator cannot remove Lync Site
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0002/lync/sites/500
Then I should receive HTTP/1.1 403 Forbidden
with following body:
{
  "title": "Access forbidden",
  "detail": "Required role is missing",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Operator cannot remove Lync Site
Given I am authenticated as Operator C0002
When I send /api/customers/K0002/lync/sites/500
Then I should receive HTTP/1.1 403 Forbidden
with following body:
{
  "title": "Access forbidden",
  "detail": "Required role is missing",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}