Api >

Service Portal REST API

GET returns Customer's Default System Integrator setting
Given I am authenticated as Operator C0002
When I send /api/customers/K0002/default-system-integrator
Then I should receive HTTP/1.1 200 OK
with following body
{
  "href": "/api/customers/K0002/default-system-integrator",
  "links": [{
    "rel": "defaultSystemIntegrator",
    "href": "/api/system-integrators/S0002"
  }, {
    "rel": "availableDefaultSystemIntegrators",
    "href": "/api/operators/C0002/system-integrators"
  }],
  "data": [{
    "name": "defaultSystemIntegrator",
    "value": "S0002 (S0002)"
  }]
}
GET returns Customer's Default System Integrator setting
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0002/default-system-integrator
Then I should receive HTTP/1.1 200 OK
with following body
{
  "href": "/api/customers/K0002/default-system-integrator",
  "links": [],
  "data": [{
    "name": "defaultSystemIntegrator",
    "value": "S0002 (S0002)"
  }]
}
Customer cannot access Default System Integrator setting
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/default-system-integrator
Then I should receive HTTP/1.1 403 Forbidden
with following body
{
  "detail": "Required role is missing",
  "title": "Access forbidden",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Missing Customer
Given I am authenticated as admin
and there is no Customer K0404 When I send /api/customers/K0404/default-system-integrator
Then I should receive HTTP/1.1 404 Not Found
with following body
{
  "title": "Customer not found",
  "detail": "Customer with identifier K0404 has not been found",
  "described_by": "http://api.nfon.net/probs/customer-not-found"
}
Customer cannot access other Customer's Default System Integrator setting
Given I am authenticated as Customer K0002
When I send /api/customers/K0003/default-system-integrator
Then I should receive HTTP/1.1 403 Forbidden
with following body
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot access Default System Integrator setting of Customer that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/default-system-integrator
Then I should receive HTTP/1.1 403 Forbidden
with following body
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Operator cannot access Default System Integrator setting of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/default-system-integrator
Then I should receive HTTP/1.1 403 Forbidden
with following body
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}