Api >

Service Portal REST API

GET a list of Customer's Speed Dials
Given I am authenticated as customer K0002
and there is a Speed Dial with
  • id: 100
  • name: SpeedDial1
  • destination: *555#1234
  • code: 1255
and there is another Speed Dial with
  • id: 200
  • name: SpeedDial2
  • destination: *222#444
  • code: 331
When I send /api/customers/K0002/speed-dials
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/speed-dials?_offset=0&_pagesize=16&_orderBy=name&_order=ASC",
  "offset": 0,
  "total": 2,
  "size": 2,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/speed-dials/100",
    "links": [],
    "data": [{
      "name": "destination",
      "value": "*555#1234"
    }, {
      "name": "name",
      "value": "SpeedDial1"
    }, {
      "name": "code",
      "value": "1255"
    }, {
      "name": "outwardDialOverwrite",
      "value": false
    }]
  }, {
    "href": "/api/customers/K0002/speed-dials/200",
    "links": [],
    "data": [{
      "name": "destination",
      "value": "*222#444"
    }, {
      "name": "name",
      "value": "SpeedDial2"
    }, {
      "name": "code",
      "value": "331"
    }, {
      "name": "outwardDialOverwrite",
      "value": false
    }]
  }]
}
GET a list of Customer's Speed Dials ordered by name descending
Given I am authenticated as customer K0002
and there is a Speed Dial with
  • id: 100
  • name: SpeedDial1
  • destination: *555#1234
  • code: 1255
and there is another Speed Dial with
  • id: 200
  • name: SpeedDial2
  • destination: *222#444
  • code: 331
When I send /api/customers/K0002/speed-dials?_orderBy=name&_order=desc
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/speed-dials?_offset=0&_pagesize=16&_orderBy=name&_order=DESC",
  "offset": 0,
  "total": 2,
  "size": 2,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/speed-dials/200",
    "links": [],
    "data": [{
      "name": "destination",
      "value": "*222#444"
    }, {
      "name": "name",
      "value": "SpeedDial2"
    }, {
      "name": "code",
      "value": "331"
    }, {
      "name": "outwardDialOverwrite",
      "value": false
    }]
  }, {
    "href": "/api/customers/K0002/speed-dials/100",
    "links": [],
    "data": [{
      "name": "destination",
      "value": "*555#1234"
    }, {
      "name": "name",
      "value": "SpeedDial1"
    }, {
      "name": "code",
      "value": "1255"
    }, {
      "name": "outwardDialOverwrite",
      "value": false
    }]
  }]
}
GET a filtered list of Customer's SpeedDials using the general full-text query
Filtering is done on fields :
  • name
  • destination
  • shortcut
Given I am authenticated as customer K0002
and there is a Speed Dial with
  • id: 100
  • name: SpeedDial1
  • destination: *555#1234
  • code: 1255
and there is another Speed Dial with
  • id: 200
  • name: SpeedDial2
  • destination: *222#444
  • code: 331
When I send /api/customers/K0002/speed-dials?_q=555
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/speed-dials?_offset=0&_pagesize=16&_q=555&_orderBy=name&_order=ASC",
  "offset": 0,
  "total": 1,
  "size": 1,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/speed-dials/100",
    "links": [],
    "data": [{
      "name": "destination",
      "value": "*555#1234"
    }, {
      "name": "name",
      "value": "SpeedDial1"
    }, {
      "name": "code",
      "value": "1255"
    }, {
      "name": "outwardDialOverwrite",
      "value": false
    }]
  }]
}
GET a filtered list of Customer's Speed Dials using the specific attribute query
Filtering is done on fields :
  • name
Given I am authenticated as customer K0002
and there is a Speed Dial with
  • id: 100
  • name: SpeedDial1
  • destination: *555#1234
  • code: 1255
and there is another Speed Dial with
  • id: 200
  • name: SpeedDial2
  • destination: *222#444
  • code: 331
When I send /api/customers/K0002/speed-dials?name=SpeedDial2
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/speed-dials?_offset=0&_pagesize=16&_orderBy=name&_order=ASC&name=SpeedDial2",
  "offset": 0,
  "total": 1,
  "size": 1,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/speed-dials/200",
    "links": [],
    "data": [{
      "name": "destination",
      "value": "*222#444"
    }, {
      "name": "name",
      "value": "SpeedDial2"
    }, {
      "name": "code",
      "value": "331"
    }, {
      "name": "outwardDialOverwrite",
      "value": false
    }]
  }]
}
GET a filtered list of Customer's Phonebooks using the specific INVERSE attribute query
Filtering is done on fields :
  • name
Given I am authenticated as customer K0002
and there is a Speed Dial with
  • id: 100
  • name: SpeedDial1
  • destination: *555#1234
  • code: 1255
and there is another Speed Dial with
  • id: 200
  • name: SpeedDial2
  • destination: *222#444
  • code: 331
When I send /api/customers/K0002/speed-dials?name=!SpeedDial2
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/speed-dials?_offset=0&_pagesize=16&_orderBy=name&_order=ASC&name=!SpeedDial2",
  "offset": 0,
  "total": 1,
  "size": 1,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/speed-dials/100",
    "links": [],
    "data": [{
      "name": "destination",
      "value": "*555#1234"
    }, {
      "name": "name",
      "value": "SpeedDial1"
    }, {
      "name": "code",
      "value": "1255"
    }, {
      "name": "outwardDialOverwrite",
      "value": false
    }]
  }]
}
GET a filtered list of Customer's Phonebooks using the specific attribute LIKE query
Filtering is done on fields :
  • name
Given I am authenticated as customer K0002
and there is a Speed Dial with
  • id: 100
  • name: SpeedDial1
  • destination: *555#1234
  • code: 1255
and there is another Speed Dial with
  • id: 200
  • name: SpeedDial2
  • destination: *222#444
  • code: 331
When I send /api/customers/K0002/speed-dials?name=~*2
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/speed-dials?_offset=0&_pagesize=16&_orderBy=name&_order=ASC&name=~*2",
  "offset": 0,
  "total": 1,
  "size": 1,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/speed-dials/200",
    "links": [],
    "data": [{
      "name": "destination",
      "value": "*222#444"
    }, {
      "name": "name",
      "value": "SpeedDial2"
    }, {
      "name": "code",
      "value": "331"
    }, {
      "name": "outwardDialOverwrite",
      "value": false
    }]
  }]
}
GET a filtered list of Customer's Phonebooks using the specific INVERSE LIKE attribute query
Filtering is done on fields :
  • name
Given I am authenticated as customer K0002
and there is a Speed Dial with
  • id: 100
  • name: SpeedDial1
  • destination: *555#1234
  • code: 1255
and there is another Speed Dial with
  • id: 200
  • name: SpeedDial2
  • destination: *222#444
  • code: 331
When I send /api/customers/K0002/speed-dials?name=!~*2
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/speed-dials?_offset=0&_pagesize=16&_orderBy=name&_order=ASC&name=!~*2",
  "offset": 0,
  "total": 1,
  "size": 1,
  "links": [],
  "items": [{
    "href": "/api/customers/K0002/speed-dials/100",
    "links": [],
    "data": [{
      "name": "destination",
      "value": "*555#1234"
    }, {
      "name": "name",
      "value": "SpeedDial1"
    }, {
      "name": "code",
      "value": "1255"
    }, {
      "name": "outwardDialOverwrite",
      "value": false
    }]
  }]
}
Missing Customer
Given I am authenticated as Admin
When I send /api/customers/K0404/phone-books
Then I should receive HTTP/1.1 404 Not Found
{
  "detail": "Customer with identifier K0404 has not been found",
  "title": "Customer not found",
  "described_by": "http://api.nfon.net/probs/customer-not-found"
}
Customer should not be able to GET another Customer's Speed Dials
Given I am authenticated as Customer K0003
When I send /api/customers/K0002/speed-dials
Then I should receive HTTP/1.1 403 Forbidden
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0002]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator should not be able to GET Speed Dials of a Customer that he cannot manage
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/speed-dials
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 should not be able to GET Speed Dials of a Customer that he cannot manage
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/speed-dials
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"
}