Api >

Service Portal REST API

GET retrieves Frontdesk Service's Inbound Trunk Number
Given I am authenticated as Admin
and there is a Frontdesk Service with service number 17
which has Inbound Trunk Number +48 (22) 1111-5
When I send /api/customers/K0002/targets/frontdesk-services/17/inbound-trunk-numbers/0048.22.1111-5
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/targets/frontdesk-services/17/inbound-trunk-numbers/0048.22.1111-5",
  "links": [{
    "rel": "trunk",
    "href": "/api/customers/K0002/trunks/0048.22.1111.0-9"
  }],
  "data": [{
    "name": "didExtension",
    "value": "5"
  }]
}
Missing Customer
Given I am authenticated as Admin
When I send /api/customers/K404/targets/frontdesk-services/17/inbound-trunk-numbers/0048.22.1111-5
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"
}
Customer can't access to resources which belongs to another Customer
Given I am authenticated as customer K0002
When I send /api/customers/K0003/targets/frontdesk-services/17/inbound-trunk-numbers/0048.22.1111-5
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 cannot retrieve Frontdesk Service's Inbound Trunk Number of Customer, that does not belong to them
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/targets/frontdesk-services/17/inbound-trunk-numbers/0048.22.1111-5
Then I should receive HTTP/1.1 403 Forbidden
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Operator cannot retrieve Frontdesk Service's Inbound Trunk Number of Customer, that does not belong to them
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/frontdesk-services/17/inbound-trunk-numbers/0048.22.1111-5
Then I should receive HTTP/1.1 403 Forbidden
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}