Api >

Service Portal REST API

GET retrieves all Queue Service's Inbound Trunk Numbers
Given I am authenticated as customer K0002
and there is a Queue Service with service number 17
which has Inbound Trunk Number +48 (22) 1111-119
and which has another Inbound Trunk Number +48 (22) 1111-234
When I send /api/customers/K0002/targets/queue-services/17/inbound-trunk-numbers
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/targets/queue-services/17/inbound-trunk-numbers?_offset=0&_pagesize=16",
  "offset": 0,
  "total": 2,
  "size": 2,
  "links": [{
    "rel": "availableTrunks",
    "href": "/api/customers/K0002/trunks"
  }],
  "items": [{
    "href": "/api/customers/K0002/targets/queue-services/17/inbound-trunk-numbers/0048.22.1111-119",
    "links": [],
    "data": [{
      "name": "trunkNumber",
      "value": "+48 (22) 1111(0-9)"
    }, {
      "name": "didNumber",
      "value": "+48 (22) 1111-119"
    }, {
      "name": "didExtension",
      "value": "119"
    }, {
      "name": "destinationExtensionNumber",
      "value": "*770017"
    }, {
      "name": "destinationDisplayName",
      "value": "some display name"
    }, {
      "name": "destinationType",
      "value": "QUEUE"
    }]
  }, {
    "href": "/api/customers/K0002/targets/queue-services/17/inbound-trunk-numbers/0048.22.1111-234",
    "links": [],
    "data": [{
      "name": "trunkNumber",
      "value": "+48 (22) 1111(0-9)"
    }, {
      "name": "didNumber",
      "value": "+48 (22) 1111-234"
    }, {
      "name": "didExtension",
      "value": "234"
    }, {
      "name": "destinationExtensionNumber",
      "value": "*770017"
    }, {
      "name": "destinationDisplayName",
      "value": "some display name"
    }, {
      "name": "destinationType",
      "value": "QUEUE"
    }]
  }]
}
GET retrieves filtered Queue Service's Inbound Trunk Numbers
Given I am authenticated as customer K0002
and there is a Queue Service with service number 17
which has Inbound Trunk Number +48 (22) 1111-119
and which has another Inbound Trunk Number +48 (22) 1111-234
and another Inbound Trunk Number +48 (22) 3444-505
When I send /api/customers/K0002/targets/queue-services/17/inbound-trunk-numbers?_q=34
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/targets/queue-services/17/inbound-trunk-numbers?_offset=0&_pagesize=16&_q=34",
  "offset": 0,
  "total": 2,
  "size": 2,
  "links": [{
    "rel": "availableTrunks",
    "href": "/api/customers/K0002/trunks"
  }],
  "items": [{
    "href": "/api/customers/K0002/targets/queue-services/17/inbound-trunk-numbers/0048.22.1111-234",
    "links": [],
    "data": [{
      "name": "trunkNumber",
      "value": "+48 (22) 1111(0-9)"
    }, {
      "name": "didNumber",
      "value": "+48 (22) 1111-234"
    }, {
      "name": "didExtension",
      "value": "234"
    }, {
      "name": "destinationExtensionNumber",
      "value": "*770017"
    }, {
      "name": "destinationDisplayName",
      "value": "some display name"
    }, {
      "name": "destinationType",
      "value": "QUEUE"
    }]
  }, {
    "href": "/api/customers/K0002/targets/queue-services/17/inbound-trunk-numbers/0048.22.3444-505",
    "links": [],
    "data": [{
      "name": "trunkNumber",
      "value": "+48 (22) 3444(0-9)"
    }, {
      "name": "didNumber",
      "value": "+48 (22) 3444-505"
    }, {
      "name": "didExtension",
      "value": "505"
    }, {
      "name": "destinationExtensionNumber",
      "value": "*770017"
    }, {
      "name": "destinationDisplayName",
      "value": "some display name"
    }, {
      "name": "destinationType",
      "value": "QUEUE"
    }]
  }]
}
Missing Customer
Given I am authenticated as Admin
When I send /api/customers/K404/targets/queue-services/17/inbound-trunk-numbers
Then I should receive HTTP/1.1 404 Not Found
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"
}
Not allowed to retrieve Queue Service's Inbound Trunk Numbers which belongs to another Customer
Given I am authenticated as customer K0002
When I send /api/customers/K0003/targets/queue-services/17/inbound-trunk-numbers
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"
}
System Integrator should not be able to GET data of a Customer that he cannot manage
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/targets/queue-services/17/inbound-trunk-numbers
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 should not be able to GET data of a Customer that he cannot manage
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/queue-services/17/inbound-trunk-numbers
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"
}