Api >

Service Portal REST API

PUT changes Customer's Default System Integrator setting
Given I am authenticated as Operator C0002
and there is a System Integrator S0004 with name New System Integrator for Operator C0002
When I send /api/customers/K0002/default-system-integrator
with application/json; charset=UTF-8 and body:
{
  "links": [{
    "rel": "defaultSystemIntegrator",
    "href": "/api/system-integrators/S0004"
  }]
}
Then I should receive HTTP/1.1 204 No Content

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
{
  "links": [{
    "rel": "defaultSystemIntegrator",
    "href": "/api/system-integrators/S0004"
  }],
  "data": [{
    "name": "defaultSystemIntegrator",
    "value": "S0004 (New System Integrator)"
  }]
}
Cannot change Customer's Default System Integrator to System Integrator, that does not belong to Customer's Operator
Given I am authenticated as Operator C0002
and there is a System Integrator S0003 with name New System Integrator for Operator C0003
When I send /api/customers/K0002/default-system-integrator
with application/json; charset=UTF-8 and body:
{
  "links": [{
    "rel": "defaultSystemIntegrator",
    "href": "/api/system-integrators/S0003"
  }]
}
Then I should receive HTTP/1.1 403 Forbidden
with following body
{
  "detail": "Access denied to [SystemIntegrator] with id [S0003]",
  "title": "Access forbidden",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Cannot change Customer's Default System Integrator to System Integrator, that does not belong to Customer's Operator
Given I am authenticated as Admin
and there is a System Integrator S0003 with name New System Integrator for Operator C0003
When I send /api/customers/K0002/default-system-integrator
with application/json; charset=UTF-8 and body:
{
  "links": [{
    "rel": "defaultSystemIntegrator",
    "href": "/api/system-integrators/S0003"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body
{
  "errors": [{
    "message": "System Integrator S0003 does not belong to Operator C0002",
    "path": "defaultSystemIntegrator",
    "value": "/api/system-integrators/S0003"
  }]
}
Cannot change Default System Integrator setting
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/default-system-integrator
with application/json; charset=UTF-8 and body
{
  "links": [{
    "rel": "defaultSystemIntegrator",
    "href": "/api/system-integrators/S0002"
  }]
}
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"
}
Cannot change Default System Integrator setting
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0002/default-system-integrator
with application/json; charset=UTF-8 and body
{
  "links": [{
    "rel": "defaultSystemIntegrator",
    "href": "/api/system-integrators/S0002"
  }]
}
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
with application/json; charset=UTF-8
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 change other Customer's Default System Integrator setting
Given I am authenticated as Customer K0002
When I send /api/customers/K0003/default-system-integrator
with application/json; charset=UTF-8
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 change 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
with application/json; charset=UTF-8
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 change 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
with application/json; charset=UTF-8
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"
}