Api >

Service Portal REST API

Update Queue Member
Given I am authenticated as customer K0002
and there is a Queue Service
  • with name queue name
  • with service number 345
  • and asterisk extension number 576
and it has a member with extension 698 and penalty 5
When I send /api/customers/K0002/targets/queue-services/345/members/698
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "penalty",
    "value": 8
  }]
}
Then I should receive HTTP/1.1 204 No Content
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services/345/members/698
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/targets/queue-services/345/members/698",
  "data": [{
    "name": "penalty",
    "value": 8
  }]
}
Cannot set incorrect penalty
Given I am authenticated as customer K0002
and there is a queue service
  • with name queue name
  • with service number 345
  • and asterisk extension number 576
and it has a member with extension 698 and penalty 5
When I send /api/customers/K0002/targets/queue-services/345/members/698
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "penalty",
    "value": 13
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "must be less than or equal to 9",
    "path": "penalty",
    "value": "13"
  }]
}
Cannot change displayName
Given I am authenticated as customer K0002
and there is a queue service
  • with name queue name
  • with service number 345
  • and asterisk extension number 576
and it has a member with extension 698 and penalty 5
When I send /api/customers/K0002/targets/queue-services/345/members/698
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": "new name"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "A readonly field is being modified with different value.",
    "path": "displayName",
    "value": "new name"
  }]
}
Cannot change extensionNumber
Given I am authenticated as customer K0002
and there is a queue service
  • with name queue name
  • with service number 345
  • and asterisk extension number 576
and it has a member with extension 698 and penalty 5
When I send /api/customers/K0002/targets/queue-services/345/members/698
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "extensionNumber",
    "value": "999"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "A readonly field is being modified with different value.",
    "path": "extensionNumber",
    "value": "999"
  }]
}
Cannot change Phone Extension of a Queue Member
Given I am authenticated as customer K0002
and there is a queue service
  • with name queue name
  • with service number 345
  • and asterisk extension number 576
and it has a member with extension 698 and penalty 5
and there is a phone extension with number 712
When I send /api/customers/K0002/targets/queue-services/345/members/698
as application/json; charset=UTF-8
with following body:
{
  "links": [{
    "rel": "phoneExtension",
    "href": "/api/customers/K0002/targets/phone-extensions/712"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "A readonly field is being modified with different value.",
    "path": "phoneExtension",
    "value": "/api/customers/K0002/targets/phone-extensions/712"
  }]
}
Missing Queue Member
Given I am authenticated as customer K0002
there is a queue service
  • with name queue name
  • with service number 345
  • and asterisk extension number 576
and it has no members
When I send that does not exist /api/customers/K0002/targets/queue-services/345/members/404
as application/json; charset=UTF-8
with following body:
{}
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
  "title": "Queue member not found",
  "detail": "Queue member with extension number 404 not found",
  "described_by": "http://api.nfon.net/probs/queue-member-not-found"
}
Missing Queue
Given there is no queue service with 404 identifier and I am authenticated as customer K0002
When I send in a queue service that does not exist /api/customers/K0002/targets/queue-services/404/members/698
as application/json; charset=UTF-8
with following body:
{}
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
  "title": "Queue not found",
  "detail": "Queue with serviceNumber 404 not found",
  "described_by": "http://api.nfon.net/probs/queue-not-found"
}
Missing Customer
Given I am authenticated as Admin
When I send in a queue service that belongs to not existing customer /api/customers/K404/targets/queue-services/345/members/698
as application/json; charset=UTF-8
with following body:
{}
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 can't access to Queue Member which belongs to another Customer
Given I am authenticated as customer K0002
When I send in a queue service that belongs to another customer /api/customers/K0003/targets/queue-services/345/members/698
as application/json; charset=UTF-8
with following body:
{}
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 should not be able to change data of a Customer that he cannot manage
Given I am authenticated as System Integrator S0002
When I send in a queue service that belongs to another customer /api/customers/K0003/targets/queue-services/345/members/698
as application/json; charset=UTF-8
with following body:
{}
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 should not be able to GET data of a Customer that he cannot manage
Given I am authenticated as Operator C0002
When I send in a queue service that belongs to another customer /api/customers/K0003/targets/queue-services/345/members/698
as application/json; charset=UTF-8
with following body:
{}
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"
}