Api >

Service Portal REST API

GET retrieves IVR Key Assignment's available destinations
Given I am authenticated as Customer K0002
and there is a IVR Service with service number 17 and ID 55
And there are
  • a Phone Extension with id 100 and extension 123 and name Phone Extension
  • a Virtual Fax Extension with id 200 and extension 223 and name Virtual Fax Extension
  • a Group Service with id 300 and extension 323 and service number 313 and name Group Service
  • a Queue Service with id 400 and extension 423 and service number 413 and name Queue Service
  • a Skill Service with id 500 and extension 523 and service number 513 and name Skill Service
  • a IVR Service with id 600 and extension 723 and service number 713 and name IVR Service
  • a Time Control Service with id 700 and extension 823 and service number 813 and name Time Control Service
  • a Conference Service with id 800 and extension 923 and service number 913 and name Conference Service
  • a Direct Dial with id 900 and number *023
  • a Phone Book with id 1000 and number +49 (66) 1234-56 and name Phone Book
  • a Voice Mail Service with Id 1100
When I send /api/customers/K0002/targets/ivr-services/17/key-assignments/target-available-destinations
Then I should receive HTTP/1.1 200 OK
with body that contains exactly:
{
  "href": "/api/customers/K0002/targets/ivr-services/17/key-assignments/target-available-destinations?_offset=0&_pagesize=16&_orderBy=extensionNumber&_order=ASC",
  "offset": 0,
  "total": 13,
  "size": 13,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/targets/NO_ACTION",
    "links": [],
    "data": [{
      "name": "name",
      "value": "No Action"
    }, {
      "name": "type",
      "value": "NOOP"
    }]
  }, {
    "href": "/api/customers/K0002/targets/REPEAT",
    "links": [],
    "data": [{
      "name": "name",
      "value": "Repeat"
    }, {
      "name": "type",
      "value": "REPEAT"
    }]
  }, {
    "href": "/api/customers/K0002/targets/HANGUP",
    "links": [],
    "data": [{
      "name": "name",
      "value": "Hang up"
    }, {
      "name": "type",
      "value": "HANG_UP"
    }]
  }, {
    "href": "/api/customers/K0002/targets/ivr-services/17",
    "links": [],
    "data": [{
      "name": "name",
      "value": "displayName"
    }, {
      "name": "extensionNumber",
      "value": "2"
    }, {
      "name": "serviceNumber",
      "value": 17
    }, {
      "name": "serviceCode",
      "value": "*760017"
    }, {
      "name": "type",
      "value": "IVR"
    }]
  }, {
    "href": "/api/customers/K0002/targets/phone-extensions/123/voice-mail",
    "links": [],
    "data": [{
      "name": "name",
      "value": "Phone Extension"
    }, {
      "name": "extensionNumber",
      "value": "123"
    }, {
      "name": "type",
      "value": "VOICEMAIL"
    }]
  }, {
    "href": "/api/customers/K0002/targets/phone-extensions/123",
    "links": [],
    "data": [{
      "name": "name",
      "value": "Phone Extension"
    }, {
      "name": "extensionNumber",
      "value": "123"
    }, {
      "name": "type",
      "value": "PHONEEXTENSION"
    }]
  }, {
    "href": "/api/customers/K0002/targets/group-services/313",
    "links": [],
    "data": [{
      "name": "name",
      "value": "Group Service"
    }, {
      "name": "extensionNumber",
      "value": "323"
    }, {
      "name": "serviceNumber",
      "value": 313
    }, {
      "name": "serviceCode",
      "value": "*750313"
    }, {
      "name": "type",
      "value": "GROUP"
    }]
  }, {
    "href": "/api/customers/K0002/targets/queue-services/413",
    "links": [],
    "data": [{
      "name": "name",
      "value": "Queue Service"
    }, {
      "name": "extensionNumber",
      "value": "423"
    }, {
      "name": "serviceNumber",
      "value": 413
    }, {
      "name": "serviceCode",
      "value": "*770413"
    }, {
      "name": "type",
      "value": "QUEUE"
    }]
  }, {
    "href": "/api/customers/K0002/targets/skill-services/513",
    "links": [],
    "data": [{
      "name": "name",
      "value": "Skill Service"
    }, {
      "name": "extensionNumber",
      "value": "523"
    }, {
      "name": "serviceNumber",
      "value": 513
    }, {
      "name": "serviceCode",
      "value": "*720513"
    }, {
      "name": "type",
      "value": "SKILL"
    }]
  }, {
    "href": "/api/customers/K0002/targets/ivr-services/713",
    "links": [],
    "data": [{
      "name": "name",
      "value": "IVR Service"
    }, {
      "name": "extensionNumber",
      "value": "723"
    }, {
      "name": "serviceNumber",
      "value": 713
    }, {
      "name": "serviceCode",
      "value": "*760713"
    }, {
      "name": "type",
      "value": "IVR"
    }]
  }, {
    "href": "/api/customers/K0002/targets/time-control-services/813",
    "links": [],
    "data": [{
      "name": "name",
      "value": "Time Control Service"
    }, {
      "name": "extensionNumber",
      "value": "823"
    }, {
      "name": "serviceNumber",
      "value": 813
    }, {
      "name": "serviceCode",
      "value": "*740813"
    }, {
      "name": "type",
      "value": "TIMECONTROL"
    }]
  }, {
    "href": "/api/customers/K0002/targets/conference-services/913",
    "links": [],
    "data": [{
      "name": "name",
      "value": "Conference Service"
    }, {
      "name": "extensionNumber",
      "value": "923"
    }, {
      "name": "serviceNumber",
      "value": 913
    }, {
      "name": "serviceCode",
      "value": "*780913"
    }, {
      "name": "type",
      "value": "CONFERENCE"
    }]
  }, {
    "href": "/api/customers/K0002/targets/VOICEMAILSERVICE",
    "links": [],
    "data": [{
      "name": "name",
      "value": "displayName"
    }, {
      "name": "extensionNumber",
      "value": "3"
    }, {
      "name": "serviceNumber",
      "value": 123
    }, {
      "name": "serviceCode",
      "value": "0123"
    }, {
      "name": "type",
      "value": "VOICEMAIL_SERVICE"
    }]
  }]
}
GET retrieves filtered IVR Key Assignment's available destinations
Filtering is done on fields :
  • serviceNumber
  • extensionNumber
  • name
Given I am authenticated as Customer K0002
and there is a IVR Service with service number 17 and ID 55
And there are
  • a Phone Extension with id 100 and extension 555 and name Phone Extension
  • a Group Service with id 300 and extension 323 and service number 4555 and name Group Service
  • a Queue Service with id 400 and extension 423 and service number 413 and name Queue Service 555
  • a Skill Service with id 500 and extension 523 and service number 513 and name Skill Service
When I send /api/customers/K0002/targets/ivr-services/17/key-assignments/target-available-destinations?_q=555
Then I should receive HTTP/1.1 200 OK
with body that contains exactly:
{
  "href": "/api/customers/K0002/targets/ivr-services/17/key-assignments/target-available-destinations?_offset=0&_pagesize=16&_q=555&_orderBy=extensionNumber&_order=ASC",
  "offset": 0,
  "total": 4,
  "size": 4,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/targets/phone-extensions/555/voice-mail",
    "links": [],
    "data": [{
      "name": "name",
      "value": "Phone Extension"
    }, {
      "name": "extensionNumber",
      "value": "555"
    }, {
      "name": "type",
      "value": "VOICEMAIL"
    }]
  }, {
    "href": "/api/customers/K0002/targets/phone-extensions/555",
    "links": [],
    "data": [{
      "name": "name",
      "value": "Phone Extension"
    }, {
      "name": "extensionNumber",
      "value": "555"
    }, {
      "name": "type",
      "value": "PHONEEXTENSION"
    }]
  }, {
    "href": "/api/customers/K0002/targets/group-services/4555",
    "links": [],
    "data": [{
      "name": "name",
      "value": "Group Service"
    }, {
      "name": "extensionNumber",
      "value": "323"
    }, {
      "name": "serviceNumber",
      "value": 4555
    }, {
      "name": "serviceCode",
      "value": "*754555"
    }, {
      "name": "type",
      "value": "GROUP"
    }]
  }, {
    "href": "/api/customers/K0002/targets/queue-services/413",
    "links": [],
    "data": [{
      "name": "name",
      "value": "Queue Service 555"
    }, {
      "name": "extensionNumber",
      "value": "423"
    }, {
      "name": "serviceNumber",
      "value": 413
    }, {
      "name": "serviceCode",
      "value": "*770413"
    }, {
      "name": "type",
      "value": "QUEUE"
    }]
  }]
}
Missing Customer
Given I am authenticated as Admin
When I send /api/customers/K404/targets/ivr-services/17/key-assignments/target-available-destinations
Then I should receive HTTP/1.1 404 Not Found
with body that contains exactly:
{
  "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 Key Assignments which belongs to another Customer
Given I am authenticated as customer K0002
When I send /api/customers/K0003/targets/ivr-services/17/key-assignments/target-available-destinations
Then I should receive HTTP/1.1 403 Forbidden
with body that contains exactly:
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot access Key Assignments 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/17/key-assignments/target-available-destinations
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 access Key Assignments of Customer, that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/ivr-services/17/key-assignments/target-available-destinations
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"
}