Api >

Service Portal REST API

DELETE unassigns inbound trunk number from 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 Number +48 (22) 1111-123
When I send /api/customers/K0002/targets/group-services/345/inbound-trunk-numbers/0048.22.1111-123
Then I should receive HTTP/1.1 204 No Content
And Inbound Trunk Number should not be assigned to Group Service
Cannot unassign missing inbound trunk number
Given I am authenticated as Customer K0002
And there is a Group Service with service number 345
When I send /api/customers/K0002/targets/group-services/345/inbound-trunk-numbers/0048.22.1111-404
Then I should receive HTTP/1.1 404 Not Found
{
  "described_by": "http://api.nfon.net/probs/inbound-trunk-number-not-found",
  "title": "Inbound Trunk Number not found",
  "detail": "Inbound Trunk Number [+48 (22) 1111-404] not found."
}
Cannot unassign inbound trunk number that is not assigned to group service
Given I am authenticated as Customer K0002
And there is a Group Service with service number 345
And there is unassigned Inbound Trunk Number +48 (22) 1111-404
When I send /api/customers/K0002/targets/group-services/345/inbound-trunk-numbers/0048.22.1111-404
Then I should receive HTTP/1.1 404 Not Found
{
  "described_by": "http://api.nfon.net/probs/inbound-trunk-number-not-found",
  "title": "Inbound Trunk Number not found",
  "detail": "Inbound Trunk Number [+48 (22) 1111-404] not found."
}
Cannot remove inbound trunk numbers of missing Group Service
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/targets/group-services/404/inbound-trunk-numbers/0048.22.1111-123
Then I should receive HTTP/1.1 404 Not Found
{
  "title": "Group not found",
  "detail": "Group with serviceNumber 404 not found",
  "described_by": "http://api.nfon.net/probs/group-not-found"
}
Admin cannot remove Inbound Trunk Number for missing Customer
Given I am authenticated as Admin
When I send /api/customers/K404/targets/group-services/345/inbound-trunk-numbers/0048.22.1111-123
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 remove Inbound Trunk Number of another Customer's Group Service
Given there is a Group Service with service number 345
and there is unassigned Inbound Trunk Number +48 (22) 1111-123
and I am authenticated as K0003
When I send /api/customers/K0002/targets/group-services/345/inbound-trunk-numbers/0048.22.1111-123
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 remove Group Service Inbound Trunk Number 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/0048.22.1111-123
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 remove Group Service Inbound Trunk Number 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/0048.22.1111-123
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"
}