Api >

Service Portal REST API

GET returns Customer's Operator Details settings
Given I am authenticated as Admin
and Customer K0002 has Pbx Group Pbx for K0002 and Sip Server with Id 15 and name Sip Server for K0002
When I send /api/customers/K0002/operator-details
Then I should receive HTTP/1.1 200 OK
with following body
{
  "href": "/api/customers/K0002/operator-details",
  "links": [{
    "rel": "operator",
    "href": "/api/operators/C0002"
  }, {
    "rel": "systemIntegrator",
    "href": "/api/system-integrators/S0002"
  }, {
    "rel": "pbxGroup",
    "href": "/api/operators/C0002/pbx-groups/Pbx%20for%20K0002"
  }, {
    "rel": "sipServer",
    "href": "/api/sip-servers/15"
  }, {
    "rel": "availablePbxGroups",
    "href": "/api/customers/K0002/available-pbx-groups"
  }],
  "data": [{
    "name": "operator",
    "value": "C0002"
  }, {
    "name": "operatorName",
    "value": "C0002"
  }, {
    "name": "systemIntegrator",
    "value": "S0002"
  }, {
    "name": "systemIntegratorName",
    "value": "S0002"
  }, {
    "name": "pbxGroupName",
    "value": "Pbx for K0002"
  }, {
    "name": "sipServerName",
    "value": "Sip Server for K0002"
  }]
}
GET returns Customer's Operator Details settings
Given I am authenticated as Operator C0002
and Customer K0002 has Pbx Group Pbx for K0002 and Sip Server with Id 15 and name Sip Server for K0002
When I send /api/customers/K0002/operator-details
Then I should receive HTTP/1.1 200 OK
with following body
{
  "href": "/api/customers/K0002/operator-details",
  "links": [{
    "rel": "systemIntegrator",
    "href": "/api/system-integrators/S0002"
  }, {
    "rel": "pbxGroup",
    "href": "/api/operators/C0002/pbx-groups/Pbx%20for%20K0002"
  }, {
    "rel": "availablePbxGroups",
    "href": "/api/customers/K0002/available-pbx-groups"
  }],
  "data": [{
    "name": "operator",
    "value": "C0002"
  }, {
    "name": "operatorName",
    "value": "C0002"
  }, {
    "name": "systemIntegrator",
    "value": "S0002"
  }, {
    "name": "systemIntegratorName",
    "value": "S0002"
  }, {
    "name": "pbxGroupName",
    "value": "Pbx for K0002"
  }, {
    "name": "sipServerName",
    "value": "Sip Server for K0002"
  }]
}
GET returns Customer's Operator Details settings
Given I am authenticated as System Integrator S0002
and Customer K0002 has Pbx Group Pbx for K0002 and Sip Server with Id 15 and name Sip Server for K0002
When I send /api/customers/K0002/operator-details
Then I should receive HTTP/1.1 200 OK
with following body
{
  "href": "/api/customers/K0002/operator-details",
  "links": [],
  "data": [{
    "name": "operator",
    "value": "C0002"
  }, {
    "name": "operatorName",
    "value": "C0002"
  }, {
    "name": "systemIntegrator",
    "value": "S0002"
  }, {
    "name": "systemIntegratorName",
    "value": "S0002"
  }, {
    "name": "pbxGroupName",
    "value": "Pbx for K0002"
  }, {
    "name": "sipServerName",
    "value": "Sip Server for K0002"
  }]
}
Customer cannot access Operator Details settings
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/operator-details
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/operator-details
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 access other Customer's Operator Details settings
Given I am authenticated as Customer K0002
When I send /api/customers/K0003/operator-details
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 access Operator Details settings of Customer that does not belong to him
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/operator-details
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 Operator Details settings of Customer that does not belong to him
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/operator-details
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"
}