Api >

Service Portal REST API

GET returns Blacklist Profile
Given I am authenticated as customer K0002
and there is a Blacklist Profile with id 123 and name Test Blacklist Profile
When I send /api/customers/K0002/blacklist-profiles/123
Then I should receive HTTP/1.1 200 OK with following body:
{
  "href": "/api/customers/K0002/blacklist-profiles/123",
  "data": [{
    "name": "name",
    "value": "Test Blacklist Profile"
  }]
}
GET returns 404 if there is no requested Blacklist Profile for given Customer
Given I am authenticated as Customer K0002
and there is a Blacklist Profile with id 123 and name Test Blacklist Profile for Customer K0003
When I send /api/customers/K0002/blacklist-profiles/123
Then I should receive HTTP/1.1 404 Not Found with following body:
{
  "title": "Blacklist Profile not found",
  "detail": "Blacklist Profile with id 123 not found",
  "described_by": "http://api.nfon.net/probs/blacklist-profile-not-found"
}
GET returns 403 if Blacklist Profile belongs to another customer
Given I am authenticated as K0002
and there is a Blacklist Profile with id 123 and name Test Blacklist Profile for Customer K0003
When I send /api/customers/K0003/blacklist-profiles/123
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"
}
GET returns 404 if customer is missing
Given I am authenticated as Admin
and there is no customer with id K0404 When I send /api/customers/K0404/blacklist-profiles/123
Then I should receive HTTP/1.1 404 Not Found with following body:
{
  "described_by": "http://api.nfon.net/probs/customer-not-found",
  "title": "Customer not found",
  "detail": "Customer with identifier K0404 has not been found"
}
System Integrator cannot access Blacklist Profile of Customer that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/blacklist-profiles/123
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 Blacklist Profile of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/blacklist-profiles/123
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"
}