Api >

Service Portal REST API

Customer skill services collection data
Given there is a skill service
  • with name skill name
  • with service number 345
  • and asterisk extension number *72002

and it has a member with extension 698 and skill level 5
and it has a member with extension 687 and skill level 3
and I am authenticated as customer K0002
When I ask for a skill /api/customers/K0002/targets/skill-services/345/members
Then I should receive HTTP/1.1 200 OK
And Content-Type header should be application/vnd.collection.next+json
with following body:
{
  "href": "/api/customers/K0002/targets/skill-services/345/members?_offset=0&_pagesize=16",
  "offset": 0,
  "total": 2,
  "size": 2,
  "links": [{
    "rel": "availablePhoneExtensions",
    "href": "/api/customers/K0002/targets/phone-extensions"
  }],
  "items": [{
    "href": "/api/customers/K0002/targets/skill-services/345/members/698",
    "links": [],
    "data": [{
      "name": "skillLevel",
      "value": 5
    }, {
      "name": "displayName",
      "value": "Extension #698"
    }, {
      "name": "extensionNumber",
      "value": "698"
    }, {
      "name": "enabled",
      "value": true
    }]
  }, {
    "href": "/api/customers/K0002/targets/skill-services/345/members/687",
    "links": [],
    "data": [{
      "name": "skillLevel",
      "value": 3
    }, {
      "name": "displayName",
      "value": "Extension #687"
    }, {
      "name": "extensionNumber",
      "value": "687"
    }, {
      "name": "enabled",
      "value": true
    }]
  }]
}
Customer skill services collection data
Filtering is done on fields :
  • skillLevel
  • displayName
  • extensionNumber
Given there is a skill service
  • with name skill name
  • with service number 345
  • and asterisk extension number *72002

and it has a member with extension 698 and skill level 5
and it has a member with extension 687 and skill level 3
and I am authenticated as customer K0002
When I ask for a skill /api/customers/K0002/targets/skill-services/345/members?_q=5
Then I should receive HTTP/1.1 200 OK
And Content-Type header should be application/vnd.collection.next+json
with following body:
{
  "href": "/api/customers/K0002/targets/skill-services/345/members?_offset=0&_pagesize=16&_q=5",
  "offset": 0,
  "total": 1,
  "size": 1,
  "links": [{
    "rel": "availablePhoneExtensions",
    "href": "/api/customers/K0002/targets/phone-extensions"
  }],
  "items": [{
    "href": "/api/customers/K0002/targets/skill-services/345/members/698",
    "links": [],
    "data": [{
      "name": "skillLevel",
      "value": 5
    }, {
      "name": "displayName",
      "value": "Extension #698"
    }, {
      "name": "extensionNumber",
      "value": "698"
    }, {
      "name": "enabled",
      "value": true
    }]
  }]
}
Missing Skill
Given there is no skill service with 404 identifier and I am authenticated as customer K0002
When I ask for skill that does not exist /api/customers/K0002/targets/skill-services/404/members
Then I should receive HTTP/1.1 404 Not Found
And Content-Type header should be application/api-problem+json
with following body:
{
  "title": "Skill service not found",
  "detail": "Skill service with serviceNumber 404 not found",
  "described_by": "http://api.nfon.net/probs/skill-service-not-found"
}
Missing Customer
Given I am authenticated as Admin
When I ask for skill for a customer that does not exist /api/customers/K404/targets/skill-services/345/members
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 K404 has not been found",
  "described_by": "http://api.nfon.net/probs/customer-not-found"
}
Customer should not be able to GET another Customer's skill members
Given there is a skill service
  • with name skill name
  • with service number 345
  • and asterisk extension number 576

and I am authenticated as Customer K0003
When I ask for a skill /api/customers/K0002/targets/skill-services/345/members
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 [K0002]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot access Skill 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/skill-services/345/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 Skill Service Members of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/skill-services/345/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"
}