Api >

Service Portal REST API

GET retrieves a IVR Service
Given I am authenticated as K0002
and there is a IVR Service with
  • service number 17
  • display name IVR Service
  • extension 43
  • interpret unknown as extension true
  • max number of digits 2
  • announcement with Id 41
When I send /api/customers/K0002/targets/ivr-services/17 Then I should receive HTTP/1.1 200 OK with following body:
{
  "href": "/api/customers/K0002/targets/ivr-services/17",
  "links": [{
    "rel": "announcement",
    "href": "/api/customers/K0002/announcements/41"
  }, {
    "rel": "destinationOnTimeout",
    "href": "/api/customers/K0002/targets/ivr-services/17/timeout"
  }, {
    "rel": "ivrKeyAssignments",
    "href": "/api/customers/K0002/targets/ivr-services/17/key-assignments"
  }, {
    "rel": "inboundTrunkNumbers",
    "href": "/api/customers/K0002/targets/ivr-services/17/inbound-trunk-numbers"
  }],
  "data": [{
    "name": "displayName",
    "value": "IVR Service"
  }, {
    "name": "extensionNumber",
    "value": "43"
  }, {
    "name": "interpretUnknownAsExtension",
    "value": true
  }, {
    "name": "maxNumberOfDigits",
    "value": 2
  }]
}
GET does not display IVR Service's extension if it starts with *
Given I am authenticated as K0002
and there is a IVR Service with
  • service number 17
  • display name IVR Service
  • extension *43
When I send /api/customers/K0002/targets/ivr-services/17 Then I should receive HTTP/1.1 200 OK with following body:
{
  "href": "/api/customers/K0002/targets/ivr-services/17",
  "data": []
}
GET returns 404 if requested IVR Service does not exist
Given I am authenticated as K0002
and there is no IVR Service with service number 404
When I send /api/customers/K0002/targets/ivr-services/404 Then I should receive HTTP/1.1 404 Not Found with following body:
{
  "title": "IVR Service not found",
  "detail": "IVR Service with service number 404 not found",
  "described_by": "http://api.nfon.net/probs/ivr-service-not-found"
}
GET returns 403 Customer tries to access other Customer's IVR Service
Given I am authenticated as K0003
and there is a IVR Service 17 that belongs to Customer K0002
When I send /api/customers/K0002/targets/ivr-services/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/ivr-services/17 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"
}
System Integrator cannot retrieve IVR Service of Customer, that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/targets/ivr-services/123
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 IVR Service of Customer, that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/ivr-services/123
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"
}