Api >

Service Portal REST API

POST creates license subscription with only basic data
Given I am authenticated as admin
and there is a Phone Extension with
  • extension number 17
  • and display name Phone Extension
When I send /api/customers/K0002/targets/license-subscriptions as application/json; charset=UTF-8 with following body:
{
  "links": [{
    "rel": "afd",
    "href": "/api/customers/K0002/targets/phone-extensions/17"
  }],
  "data": [{
    "name": "licenseType",
    "value": "phoneextension"
  }, {
    "name": "uuid",
    "value": "6d7eec8c255bed0231665d558132"
  }]
}
Then I should receive HTTP/1.1 201 Created with http://localhost:9998/api/customers/K0002/targets/license-subscriptions/6d7eec8c255bed0231665d558132
with following body:
{
  "href": "/api/customers/K0002/targets/license-subscriptions/6d7eec8c255bed0231665d558132",
  "links": [],
  "data": null
}
Given I am authenticated as customer K0002
Then request /api/customers/K0002/targets/license-subscriptions/6d7eec8c255bed0231665d558132 returns HTTP/1.1 200 OK with following body:
{
  "links": [{
    "rel": "afd",
    "href": "/api/customers/K0002/targets/phone-extensions/17"
  }],
  "data": [{
    "name": "licenseType",
    "value": "phoneextension"
  }, {
    "name": "uuid",
    "value": "6d7eec8c255bed0231665d558132"
  }]
}
Operator cannot create license subscription
Given I am authenticated as Operator C0002
and there is a Phone Extension with
  • extension number 17
  • and display name Phone Extension
When I send /api/customers/K0002/targets/license-subscriptions as application/json; charset=UTF-8 with following body:
{
  "links": [{
    "rel": "afd",
    "href": "/api/customers/K0002/targets/phone-extensions/17"
  }],
  "data": [{
    "name": "licenseType",
    "value": "phoneextension"
  }, {
    "name": "uuid",
    "value": "6d7eec8c255bed0231665d558132"
  }]
}
Then I should receive HTTP/1.1 403 Forbidden
with following body
{
  "detail": "Required role is missing",
  "title": "Access forbidden",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot create license subscription
Given I am authenticated as System Integrator S0002
and there is a Phone Extension with
  • extension number 17
  • and display name Phone Extension
When I send /api/customers/K0002/targets/license-subscriptions as application/json; charset=UTF-8 with following body:
{
  "links": [{
    "rel": "afd",
    "href": "/api/customers/K0002/targets/phone-extensions/17"
  }],
  "data": [{
    "name": "licenseType",
    "value": "phoneextension"
  }, {
    "name": "uuid",
    "value": "6d7eec8c255bed0231665d558132"
  }]
}
Then I should receive HTTP/1.1 403 Forbidden
with following body
{
  "detail": "Required role is missing",
  "title": "Access forbidden",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Customer cannot create license subscription
Given I am authenticated as customer K0002
and there is a Phone Extension with
  • extension number 17
  • and display name Phone Extension
When I send /api/customers/K0002/targets/license-subscriptions as application/json; charset=UTF-8 with following body:
{
  "links": [{
    "rel": "afd",
    "href": "/api/customers/K0002/targets/phone-extensions/17"
  }],
  "data": [{
    "name": "licenseType",
    "value": "phoneextension"
  }, {
    "name": "uuid",
    "value": "6d7eec8c255bed0231665d558132"
  }]
}
Then I should receive HTTP/1.1 403 Forbidden
with following body
{
  "detail": "Required role is missing",
  "title": "Access forbidden",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}