Api >

Service Portal REST API

DELETE removes Customer's Phonebook
Given I am authenticated as customer K0002
and there is a Phone Book with
  • id: 100
  • number: +49 (66) 1234-555
  • name: Phone Book
When I send /api/customers/K0002/phone-books/100
Then I should receive HTTP/1.1 204 No Content
Given I am authenticated as customer K0002
When I send /api/customers/K0002/phone-books/100
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
  "detail": "Phone Book with ID 100 has not been found",
  "title": "Phone Book not found",
  "described_by": "http://api.nfon.net/probs/phone-book-not-found"
}
Cannot delete Phone Book of another Customer by ID
Given I am authenticated as customer K0003
and there is a Phone Book with
  • id: 100
  • number: +49 (66) 1234-555
  • name: Phone Book
which belongs to Customer K0002
When I send /api/customers/K0003/phone-books/100
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
  "detail": "Phone Book with ID 100 has not been found",
  "title": "Phone Book not found",
  "described_by": "http://api.nfon.net/probs/phone-book-not-found"
}
Missing Phone Book
Given I am authenticated as customer K0002
And there is no Phone Book with ID 404 When I send /api/customers/K0002/phone-books/404
Then I should receive HTTP/1.1 404 Not Found
{
  "detail": "Phone Book with ID 404 has not been found",
  "title": "Phone Book not found",
  "described_by": "http://api.nfon.net/probs/phone-book-not-found"
}
Missing Customer
Given I am authenticated as Admin
When I send /api/customers/K0404/phone-books/100
Then I should receive HTTP/1.1 404 Not Found
{
  "detail": "Customer with identifier K0404 has not been found",
  "title": "Customer not found",
  "described_by": "http://api.nfon.net/probs/customer-not-found"
}
Customer should not be able to DELETE another Customer's Phone Book
Given I am authenticated as Customer K0003
When I send /api/customers/K0002/targets/phone-books/100
Then I should receive HTTP/1.1 403 Forbidden
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0002]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator should not be able to DELETE Phone Book of a Customer that he cannot manage
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/targets/phone-books/100
Then I should receive HTTP/1.1 403 Forbidden
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Operator should not be able to DELETE Phone Book of a Customer that he cannot manage
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/phone-books/100
Then I should receive HTTP/1.1 403 Forbidden
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}