Api >

Service Portal REST API

GET retrieves all details of requested Routing Prefix Extension
Given I am authenticated as customer K0002
And there is a Trunk with ID 901901
which has:
  • has baseNumber: +48 (22) 123456
  • has numberblockStart: 0
  • has numberblockEnd: 20
And there is a Routing Prefix Extension with
  • extension number 17
  • and display name Routing Prefix Extension
  • and language en
  • and costCenter Cost Center
  • and dialPrefix 9
  • and blacklistProfile with id 43
  • and primary device ABCDEF012345
  • and prefixMinimumLength is set to 4
  • and prefixMaximumLength is set to 10
When I send /api/customers/K0002/targets/routing-prefix/17
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/targets/routing-prefix/17",
  "links": [{
    "rel": "devices",
    "href": "/api/customers/K0002/targets/routing-prefix/17/devices"
  }, {
    "rel": "inboundTrunkNumbers",
    "href": "/api/customers/K0002/targets/routing-prefix/17/inbound-trunk-numbers"
  }, {
    "rel": "primaryDevice",
    "href": "/api/customers/K0002/devices/standard/ABCDEF012345"
  }, {
    "rel": "blacklistProfile",
    "href": "/api/customers/K0002/blacklist-profiles/43"
  }, {
    "rel": "availableBlacklistProfiles",
    "href": "/api/customers/K0002/blacklist-profiles"
  }, {
    "rel": "timezone",
    "href": "INHERIT"
  }],
  "data": [{
    "name": "extensionNumber",
    "value": "17"
  }, {
    "name": "displayName",
    "value": "Routing Prefix Extension"
  }, {
    "name": "prefixMinimumLength",
    "value": 4
  }, {
    "name": "prefixMaximumLength",
    "value": 10
  }, {
    "name": "language",
    "value": "en"
  }, {
    "name": "costCenter",
    "value": "Cost Center"
  }, {
    "name": "dialPrefix",
    "value": "9"
  }]
}
GET returns 404 if requested Routing Prefix Extension is missing
Given I am authenticated as customer K0002
and there is no Routing Prefix Extension with Id 404 When I send /api/customers/K0002/targets/routing-prefix/404
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
  "detail": "routing prefix extension with extension number 404 has not been found",
  "title": "Routing prefix extension not found",
  "described_by": "http://api.nfon.net/probs/extension-not-found"
}
GET returns 403 if Customer tries to access another Customer's Routing Prefix Extension
Given I am authenticated as K0003
and there is a Routing Prefix Extension with extension number 17 assigned to K0002
When I send /api/customers/K0002/targets/routing-prefix/17
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"
}
Missing customer
Given I am authenticated as admin
When I send /api/customers/K404/targets/routing-prefix/17
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 Routing Prefix Extension of Customer that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/targets/routing-prefix/17
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 Routing Prefix Extension of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/routing-prefix/17
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"
}