Api >

Service Portal REST API

GET group service by service number (basic fields)
Given I am authenticated as Customer K0002
and there is a Group Service with service number 345 and name Group Service
When I send /api/customers/K0002/targets/group-services/345
Then I should receive HTTP/1.1 200 OK with body including
{
  "data": [{
    "name": "displayName",
    "value": "Group Service"
  }, {
    "name": "extensionNumber",
    "value": "2"
  }, {
    "name": "serviceNumber",
    "value": 345
  }, {
    "name": "pickUpGroup",
    "value": false
  }]
}
GET group service by service number (basic links)
Given I am authenticated as Customer K0002
and there is a Group Service with service number 345
When I send /api/customers/K0002/targets/group-services/345
Then I should receive HTTP/1.1 200 OK with body including
{
  "href": "/api/customers/K0002/targets/group-services/345",
  "links": [{
    "rel": "inboundTrunkNumbers",
    "href": "/api/customers/K0002/targets/group-services/345/inbound-trunk-numbers"
  }, {
    "rel": "members",
    "href": "/api/customers/K0002/targets/group-services/345/members"
  }, {
    "rel": "timeout",
    "href": "/api/customers/K0002/targets/group-services/345/timeout"
  }, {
    "rel": "availableTimeoutDestinations",
    "href": "/api/customers/K0002/targets/group-services/available-destinations-on-timeout"
  }]
}
GET 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
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 of missing Customer
Given I am authenticated as Admin
When I send /api/customers/K0404/targets/group-services/345
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 of another Customer
Given there is a Group Service with service number 345
and I am authenticated as Customer K0003
When I send /api/customers/K0002/targets/group-services/345
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 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/345
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 of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/group-services/345
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"
}