Api >

Service Portal REST API

GET retrieves available Contract Types
Given I am authenticated as Admin
When I send /api/customers/K0002/cti-billing-modes
Then I should receive HTTP/1.1 200 OK
with following body
{
  "href": "/api/customers/K0002/cti-billing-modes",
  "items": [{
    "href": null,
    "links": [],
    "data": [{
      "name": "name",
      "value": "ON"
    }]
  }, {
    "href": null,
    "links": [],
    "data": [{
      "name": "name",
      "value": "OFF"
    }]
  }, {
    "href": null,
    "links": [],
    "data": [{
      "name": "name",
      "value": "TRIAL"
    }]
  }],
  "links": null
}
GET retrieves available Contract Types
Given I am authenticated
When I send /api/customers/K0002/cti-billing-modes
Then I should receive HTTP/1.1 200 OK
with following body
{
  "href": "/api/customers/K0002/cti-billing-modes",
  "items": [{
    "href": null,
    "links": [],
    "data": [{
      "name": "name",
      "value": "ON"
    }]
  }, {
    "href": null,
    "links": [],
    "data": [{
      "name": "name",
      "value": "OFF"
    }]
  }, {
    "href": null,
    "links": [],
    "data": [{
      "name": "name",
      "value": "TRIAL"
    }]
  }],
  "links": null
}
Given I am authenticated
and there is a Customer with ID K0002 with:
  • cti trial period end is set to 2014-01-01T12:00:00+0100
When I send /api/customers/K0002/cti-billing-modes
Then I should receive HTTP/1.1 200 OK
with following body
{
  "href": "/api/customers/K0002/cti-billing-modes",
  "items": [{
    "href": null,
    "links": [],
    "data": [{
      "name": "name",
      "value": "ON"
    }]
  }, {
    "href": null,
    "links": [],
    "data": [{
      "name": "name",
      "value": "OFF"
    }]
  }],
  "links": null
}
Missing Customer
Given I am authenticated as Admin
When I send /api/customers/K404/cti-billing-modes
Then I should receive HTTP/1.1 404 Not Found
And Content-Type header should be application/api-problem+json
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"
}
Customer cannot access Cti Billing Modes
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/cti-billing-modes
Then I should receive HTTP/1.1 403 Forbidden
And Content-Type header should be application/api-problem+json
with following body:
{
  "detail": "Required role is missing",
  "title": "Access forbidden",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}