Api >

Service Portal REST API

Customer Should GET a skill service's destination on rejection
Given I am authenticated as customer K0002
And there is a skill service with service number 345
When I send /api/customers/K0002/targets/skill-services/345/destination-on-rejection
Then I should receive HTTP/1.1 200 OK
And Content-Type header should be application/vnd.collection.next+json
with following body:
{
  "href": "/api/customers/K0002/targets/skill-services/345/destination-on-rejection",
  "links": [{
    "rel": "destinationOnRejection",
    "href": "/api/customers/K0002/targets/NO_ACTION"
  }, {
    "rel": "availableDestinations",
    "href": "/api/customers/K0002/targets/skill-services/available-destinations-on-rejection"
  }],
  "data": [{
    "name": "joinEmpty",
    "value": true
  }]
}
Shouldn't return skill service's destination on rejection for OUTBOUND Skill
Given I am authenticated as customer K0002
And there is OUTBOUND skill service with service number 345
When I send /api/customers/K0002/targets/skill-services/345/destination-on-rejection
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Operation not allowed for OUTBOUND direction"
  }]
}
Missing Skill
Given I am authenticated as customer K0002
and there is no skill service with 404 identifier
When I send /api/customers/K0002/targets/skill-services/404/destination-on-rejection
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
  "title": "Skill service not found",
  "detail": "Skill service with serviceNumber 404 not found",
  "described_by": "http://api.nfon.net/probs/skill-service-not-found"
}
Missing Customer
Given I am authenticated as Admin
When I send /api/customers/K404/targets/skill-services/345/destination-on-rejection
Then I should receive HTTP/1.1 404 Not Found
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 should not be able to GET another Customer's Skill's Destination On Rejection
Given there is a skill service with service number 345
and I am authenticated as Customer K0003
When I send /api/customers/K0002/targets/skill-services/345/destination-on-rejection
Then I should receive HTTP/1.1 403 Forbidden
with following body:
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0002]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot access Skill Service destination on Rejection of Customer that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/targets/skill-services/345/destination-on-rejection
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 Skill Service destination on Rejection of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/skill-services/345/destination-on-rejection
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"
}