Api >

Service Portal REST API

GET lists inbound trunk numbers assigned to group service
Given I am authenticated as Customer K0002
and there is a Group Service with service number 345
And it has assigned following Inbound Trunk Numbers:
  • +48 (22) 1111-123
  • +48 (22) 5555-666
When I send /api/customers/K0002/targets/group-services/345/inbound-trunk-numbers
Then I should receive HTTP/1.1 200 OK with body including
{
  "href": "/api/customers/K0002/targets/group-services/345/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/group-services/345/inbound-trunk-numbers/0048.22.1111-123",
    "links": [],
    "data": [{
      "name": "trunkNumber",
      "value": "+48 (22) 1111(0-9)"
    }, {
      "name": "didNumber",
      "value": "+48 (22) 1111-123"
    }, {
      "name": "didExtension",
      "value": "123"
    }, {
      "name": "destinationExtensionNumber",
      "value": "2"
    }, {
      "name": "destinationDisplayName",
      "value": "displayName"
    }, {
      "name": "destinationType",
      "value": "GROUP"
    }]
  }, {
    "href": "/api/customers/K0002/targets/group-services/345/inbound-trunk-numbers/0048.22.5555-666",
    "links": [],
    "data": [{
      "name": "trunkNumber",
      "value": "+48 (22) 5555(0-9)"
    }, {
      "name": "didNumber",
      "value": "+48 (22) 5555-666"
    }, {
      "name": "didExtension",
      "value": "666"
    }, {
      "name": "destinationExtensionNumber",
      "value": "2"
    }, {
      "name": "destinationDisplayName",
      "value": "displayName"
    }, {
      "name": "destinationType",
      "value": "GROUP"
    }]
  }]
}
GET lists filtered inbound trunk numbers assigned to group service
Given I am authenticated as Customer K0002
and there is a Group Service with service number 345
And it has assigned following Inbound Trunk Numbers:
  • +48 (22) 1111-123
  • +48 (22) 5555-666
  • +48 (22) 2222-555
When I send /api/customers/K0002/targets/group-services/345/inbound-trunk-numbers?_q=555
Then I should receive HTTP/1.1 200 OK with body including
{
  "href": "/api/customers/K0002/targets/group-services/345/inbound-trunk-numbers?_offset=0&_pagesize=16&_q=555",
  "offset": 0,
  "total": 2,
  "size": 2,
  "links": [{
    "rel": "availableTrunks",
    "href": "/api/customers/K0002/trunks"
  }],
  "items": [{
    "href": "/api/customers/K0002/targets/group-services/345/inbound-trunk-numbers/0048.22.5555-666",
    "links": [],
    "data": [{
      "name": "trunkNumber",
      "value": "+48 (22) 5555(0-9)"
    }, {
      "name": "didNumber",
      "value": "+48 (22) 5555-666"
    }, {
      "name": "didExtension",
      "value": "666"
    }, {
      "name": "destinationExtensionNumber",
      "value": "2"
    }, {
      "name": "destinationDisplayName",
      "value": "displayName"
    }, {
      "name": "destinationType",
      "value": "GROUP"
    }]
  }, {
    "href": "/api/customers/K0002/targets/group-services/345/inbound-trunk-numbers/0048.22.2222-555",
    "links": [],
    "data": [{
      "name": "trunkNumber",
      "value": "+48 (22) 2222(0-9)"
    }, {
      "name": "didNumber",
      "value": "+48 (22) 2222-555"
    }, {
      "name": "didExtension",
      "value": "555"
    }, {
      "name": "destinationExtensionNumber",
      "value": "2"
    }, {
      "name": "destinationDisplayName",
      "value": "displayName"
    }, {
      "name": "destinationType",
      "value": "GROUP"
    }]
  }]
}
Cannot get list of inbound trunk numbers for missing Group Service
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/targets/group-services/404/inbound-trunk-numbers
Then I should receive HTTP/1.1 404 Not Found with body including
{
  "title": "Group not found",
  "detail": "Group with serviceNumber 404 not found",
  "described_by": "http://api.nfon.net/probs/group-not-found"
}
Admin cannot get list of Inbound Trunk Numbers for missing Customer
Given I am authenticated as admin
When I send /api/customers/K404/targets/group-services/345/inbound-trunk-numbers
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"
}
Customer cannot get list of Inbound Trunk Number of another Customer's Group Service
Given there is a Group Service with service number 345
and I am authenticated as K0003
When I send /api/customers/K0002/targets/group-services/345/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 [K0002]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot access Group Service Inbound Trunk Numbers of Customer that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/targets/group-services/345/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 cannot access Group Service Inbound Trunk Numbers of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/group-services/345/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"
}