Api >

Service Portal REST API

GET retrieves all details of customer's license subscriptions
Given I am authenticated as customer K0002
and there is a Phone Extension with
  • extension number 17
  • and display name Phone Extension
  • and there is a phoneextension subscription
  • and there is a mobility-option subscription
  • and there is a minute-pack subscription
When I send /api/customers/K0002/targets/license-subscriptions
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/targets/license-subscriptions?_offset=0&_pagesize=16",
  "offset": 0,
  "total": 3,
  "size": 3,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/targets/license-subscriptions/6d7eec8c255bed0231665d558132",
    "links": [{
      "rel": "afd",
      "href": "/api/customers/K0002/targets/phone-extensions/17"
    }],
    "data": [{
      "name": "licenseType",
      "value": "phoneextension"
    }, {
      "name": "uuid",
      "value": "6d7eec8c255bed0231665d558132"
    }]
  }, {
    "href": "/api/customers/K0002/targets/license-subscriptions/6d7eec8c255bed0231665d558132",
    "links": [{
      "rel": "afd",
      "href": "/api/customers/K0002/targets/phone-extensions/17"
    }],
    "data": [{
      "name": "licenseType",
      "value": "mobility-option"
    }, {
      "name": "uuid",
      "value": "6d7eec8c255bed0231665d558132"
    }]
  }, {
    "href": "/api/customers/K0002/targets/license-subscriptions/6d7eec8c255bed0231665d558132",
    "links": [{
      "rel": "afd",
      "href": "/api/customers/K0002/targets/phone-extensions/17"
    }],
    "data": [{
      "name": "licenseType",
      "value": "minute-pack"
    }, {
      "name": "uuid",
      "value": "6d7eec8c255bed0231665d558132"
    }]
  }]
}
Missing customer
Given I am authenticated as admin
When I send /api/customers/K404/targets/license-subscriptions
Then I should get HTTP/1.1 404 Not Found
{
  "title": "Customer not found",
  "detail": "Customer with identifier K404 has not been found",
  "described_by": "http://api.nfon.net/probs/customer-not-found"
}
System Integrator cannot access License Subscriptions of Customer that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/targets/license-subscriptions
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 License Subscriptions of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/license-subscriptions
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"
}
GET returns 403 if Customer tries to access another Customer's License Subscriptions
Given I am authenticated as K0003
and there is a Phone Extension with
  • extension number 17
  • and display name Phone Extension
When I send /api/customers/K0002/targets/license-subscriptions
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"
}