Api >

Service Portal REST API

GET group service members by service number
Given I am authenticated as Customer K0002
and there is a Group Service with service number 345 and it has following members assigned:
  • Adam (ext. 200)
  • Betty (ext. 201)
When I send /api/customers/K0002/targets/group-services/345/members
Then I should receive HTTP/1.1 200 OK with body including And application/vnd.collection.next+json
{
  "offset": 0,
  "total": 2,
  "size": 2,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/targets/group-services/345/members/200",
    "links": [{
      "rel": "phoneExtension",
      "href": "/api/customers/K0002/targets/phone-extensions/200"
    }],
    "data": [{
      "name": "displayName",
      "value": "Adam"
    }, {
      "name": "extensionNumber",
      "value": "200"
    }]
  }, {
    "href": "/api/customers/K0002/targets/group-services/345/members/201",
    "links": [{
      "rel": "phoneExtension",
      "href": "/api/customers/K0002/targets/phone-extensions/201"
    }],
    "data": [{
      "name": "displayName",
      "value": "Betty"
    }, {
      "name": "extensionNumber",
      "value": "201"
    }]
  }]
}
Cannot get members of missing group service
Given I am authenticated as Customer K0002
and there is no Group Service with service number 404
When I send /api/customers/K0002/targets/group-services/404/members
Then I should receive HTTP/1.1 404 Not Found with body including
{
  "title": "Group not found",
  "detail": "Group with serviceNumber 404 not found",
  "described_by": "http://api.nfon.net/probs/group-not-found"
}
Admin cannot get Group Service Members of missing Customer
Given I am authenticated as Admin
When I send /api/customers/K0404/targets/group-services/123/members
Then I should receive HTTP/1.1 404 Not Found
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 Group Service Members of another Customer
And there is a Group Service with service number 123 and I am authenticated as Customer K0003
When I send /api/customers/K0002/targets/group-services/123/members
Then I should receive HTTP/1.1 403 Forbidden
with following body
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0002]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot access Group Service Members of Customer that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/targets/group-services/123/members
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 access Group Service Members of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/group-services/123/members
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"
}