Api >

Service Portal REST API

GET a list of all available Phone Extensions that can be set as Phone Book's visibility
Given I am authenticated as customer K0002
and there is a Phone Book with
  • id: 100
  • number: +49 (66) 1234-555
  • name: Phone Book
And it is visible for:
  • a Phone Extension with extension number 555 and display name Extension1
and there is a Phone Extension with
  • extension number 777
  • and display name Extension2
and there is another Phone Extension with
  • extension number 888
  • and display name Extension3
and there is another Phone Extension that belongs to Customer K0003 with
  • extension number 999
  • and display name Extension4
When I send /api/customers/K0002/phone-books/100/visibilities/available-phone-extensions
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/phone-books/100/visibilities/available-phone-extensions?_offset=0&_pagesize=16",
  "offset": 0,
  "total": 2,
  "size": 2,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/targets/phone-extensions/777",
    "data": [{
      "name": "extensionNumber",
      "value": "777"
    }, {
      "name": "displayName",
      "value": "Extension2"
    }]
  }, {
    "href": "/api/customers/K0002/targets/phone-extensions/888",
    "data": [{
      "name": "extensionNumber",
      "value": "888"
    }, {
      "name": "displayName",
      "value": "Extension3"
    }]
  }]
}
GET a list of filtered available Phone Extensions that can be set as Phone Book's visibility
Filtering is done on fields :
  • displayName
  • extensionNumber
Given I am authenticated as customer K0002
and there is a Phone Book with
  • id: 100
  • number: +49 (66) 1234-555
  • name: Phone Book
And it is visible for:
  • a Phone Extension with extension number 555 and display name Extension1
and there is a Phone Extension with
  • extension number 777
  • and display name Extension2
and there is another Phone Extension with
  • extension number 888
  • and display name Extension3
When I send /api/customers/K0002/phone-books/100/visibilities/available-phone-extensions?_q=777
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/phone-books/100/visibilities/available-phone-extensions?_offset=0&_pagesize=16&_q=777",
  "offset": 0,
  "total": 1,
  "size": 1,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/targets/phone-extensions/777",
    "data": [{
      "name": "extensionNumber",
      "value": "777"
    }, {
      "name": "displayName",
      "value": "Extension2"
    }]
  }]
}
GET returns Phone Extensions that are already used by another Phone Book
Given I am authenticated as customer K0002
and there is a Phone Book with
  • id: 100
  • number: +49 (66) 1234-555
and there is another Phone Book with
  • id: 200
  • number: +49 (66) 1234-777
And it is visible for:
  • a Phone Extension with extension number 555 and display name Extension1
When I send /api/customers/K0002/phone-books/100/visibilities/available-phone-extensions
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/phone-books/100/visibilities/available-phone-extensions?_offset=0&_pagesize=16",
  "offset": 0,
  "total": 1,
  "size": 1,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/targets/phone-extensions/555",
    "data": [{
      "name": "extensionNumber",
      "value": "555"
    }, {
      "name": "displayName",
      "value": "Extension1"
    }]
  }]
}
Missing Phone Book
Given I am authenticated as customer K0002
And there is no Phone Book with ID 404 When I send /api/customers/K0002/phone-books/404/visibilities/available-phone-extensions
Then I should receive HTTP/1.1 404 Not Found
{
  "detail": "Phone Book with ID 404 has not been found",
  "title": "Phone Book not found",
  "described_by": "http://api.nfon.net/probs/phone-book-not-found"
}