Api >

Service Portal REST API

GET retrieves available customer category
Given I am authenticated
When I send /api/customers/K0002/category
Then I should receive HTTP/1.1 200 OK
with following body
{
  "href": "/api/customers/K0002/category",
  "items": [{
    "href": null,
    "links": [],
    "data": [{
      "name": "name",
      "value": "A"
    }]
  }, {
    "href": null,
    "links": [],
    "data": [{
      "name": "name",
      "value": "B"
    }]
  }, {
    "href": null,
    "links": [],
    "data": [{
      "name": "name",
      "value": "C"
    }]
  }, {
    "href": null,
    "links": [],
    "data": [{
      "name": "name",
      "value": "D"
    }]
  }],
  "links": null
}
Missing Customer
Given I am authenticated as Admin
When I send /api/customers/K404/category
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 customer category
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/category
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"
}