Api >

Service Portal REST API

Admin can GET all Customer's Lync Gateways
Given I am authenticated as Admin
and there is a Lync Gateway with id 200 and name Lync Gateway A
and it has IP set to one.nfon.net
and another a Lync Gateway with id 201 and name Lync Gateway B
and it has domain set to two.nfon.net
When I send /api/customers/K0002/lync/gateways
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/lync/gateways?_offset=0&_pagesize=16",
  "offset": 0,
  "total": 2,
  "size": 2,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/lync/gateways/200",
    "links": [],
    "data": [{
      "name": "description",
      "value": "Lync Gateway A"
    }, {
      "name": "gatewayIp",
      "value": "one.nfon.net"
    }]
  }, {
    "href": "/api/customers/K0002/lync/gateways/201",
    "links": [],
    "data": [{
      "name": "description",
      "value": "Lync Gateway B"
    }, {
      "name": "gatewayIp",
      "value": "two.nfon.net"
    }]
  }]
}
Admin can GET filtered Customer's Lync Gateways
Filtering is done on fields :
  • description
  • gatewayIp
Given I am authenticated as Admin
and there is a Lync Gateway with id 200 and name Lync Gateway A
and it has IP set to one.nfon.net
and another a Lync Gateway with id 201 and name Lync Gateway B
and it has domain set to two.nfon.net
When I send /api/customers/K0002/lync/gateways?_q=two
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/lync/gateways?_offset=0&_pagesize=16&_q=two",
  "offset": 0,
  "total": 1,
  "size": 1,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/lync/gateways/201",
    "links": [],
    "data": [{
      "name": "description",
      "value": "Lync Gateway B"
    }, {
      "name": "gatewayIp",
      "value": "two.nfon.net"
    }]
  }]
}
Fail meaningfully when getting sites for not existing Customer
Given I am authenticated as Admin
When I ask for lync sites of not existing Customer /api/customers/K0404/lync/sites
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"
}
Customer cannot GET Lync Gateways
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/lync/gateways
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 GET Lync Gateways
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0002/lync/gateways
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"
}
Operator cannot GET Lync Gateways
Given I am authenticated as Operator C0002
When I send /api/customers/K0002/lync/gateways
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"
}