Api >

Service Portal REST API

Admin can GET Customer Lync Gateway
Given I am authenticated as Admin
and there is a Lync Gateway with id 200 and name Lync Gateway A
When I send /api/customers/K0002/lync/gateways/200
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/lync/gateways/200",
  "links": [],
  "data": [{
    "name": "description",
    "value": "Lync Gateway A"
  }, {
    "name": "gatewayIp",
    "value": "demo.nfon.net"
  }]
}
Fail meaningfully when getting Lync Gateway for not existing Customer
Given I am authenticated as Admin
When I ask for lync sites of not existing Customer /api/customers/K0404/lync/gateways/500
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"
}
Fail meaningfully when getting not existing Lync Gateway
Given I am authenticated as Admin
When I ask for not existing lync gateway /api/customers/K0002/lync/gateways/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 Gateway not found",
  "detail": "Lync Gateway with id 404 not found",
  "described_by": "http://api.nfon.net/probs/lync-gateway-not-found"
}
Fail meaningfully when getting Lync Gateway for wrong Customer
Given I am authenticated as Admin
and there is a Lync Gateway with id 200 and name Lync Gateway A
When I ask for lync gateway of another Customer /api/customers/K0003/lync/gateways/200
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 Gateway not found",
  "detail": "Lync Gateway with id 200 not found",
  "described_by": "http://api.nfon.net/probs/lync-gateway-not-found"
}
Customer cannot see Lync Gateway
Given I am authenticated as customer K0002
and there is a Lync Gateway with id 200 and name Lync Gateway A
When I send /api/customers/K0002/lync/gateways/200
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"
}
System Integrator cannot see Lync Gateway
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0002/lync/gateways/200
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 see Lync Gateway
Given I am authenticated as Operator C0002
When I send /api/customers/K0002/lync/gateways/200
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"
}