Api >

Service Portal REST API

GET retrieves all Customer's Lync Sites
Given I am authenticated as customer K0002
and there is a Lync Gateway with id 200 and name Lync Gateway A
and there is a LyncSite with id 500 and name Lync Site A
and there is a LyncSite with id 501 and name Lync Site B
When I send /api/customers/K0002/lync/sites
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/lync/sites?_offset=0&_pagesize=16",
  "offset": 0,
  "total": 2,
  "size": 2,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/lync/sites/500",
    "links": [],
    "data": [{
      "name": "serverName",
      "value": "Lync Gateway A"
    }, {
      "name": "domain",
      "value": "nfon.net"
    }, {
      "name": "description",
      "value": "Lync Site A"
    }]
  }, {
    "href": "/api/customers/K0002/lync/sites/501",
    "links": [],
    "data": [{
      "name": "serverName",
      "value": "Lync Gateway A"
    }, {
      "name": "domain",
      "value": "nfon.net"
    }, {
      "name": "description",
      "value": "Lync Site B"
    }]
  }]
}
GET retrieves filtered Customer's Lync Sites
Filtering is done on fields :
  • serverName
  • domain
  • description
Given I am authenticated as customer K0002
and there is a Lync Gateway with id 200 and name Lync Gateway A
and there is a LyncSite with id 500 and name Lync&Site A
and there is a LyncSite with id 501 and name Lync&Site B
When I send /api/customers/K0002/lync/sites?_q=%26site+b
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/lync/sites?_offset=0&_pagesize=16&_q=%26site+b",
  "offset": 0,
  "total": 1,
  "size": 1,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/lync/sites/501",
    "links": [],
    "data": [{
      "name": "serverName",
      "value": "Lync Gateway A"
    }, {
      "name": "domain",
      "value": "nfon.net"
    }, {
      "name": "description",
      "value": "Lync&Site B"
    }]
  }]
}
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"
}
Getting Lync Sites for another Customer is forbidden
Given I am authenticated as customer K0002
When I ask for lync sites of another Customer /api/customers/K0003/lync/sites
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": "Access denied to [Customer] with id [K0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot GET list of Lync Site for Customer, that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/lync/sites/500
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 GET list of Lync Site for Customer, that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/lync/sites/500
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"
}