Api >

Service Portal REST API

PUT System Integrator
Given I am authenticated as operator C0002
and there is System Integrator S0123 defined for Operator C0002
and there is a rating profile Another Profile which is used by operator C0002
When I send /api/system-integrators/S0123 as application/json; charset=UTF-8
with following body:
{
  "links": [{
    "rel": "defaultRatingProfile",
    "href": "/api/operators/C0002/rating-profiles/Another%20Profile"
  }, {
    "rel": "timezone",
    "href": "/api/time-zones/Europe.Berlin"
  }],
  "data": [{
    "name": "name",
    "value": "Changed name"
  }, {
    "name": "contactName",
    "value": "Changed contact name"
  }, {
    "name": "contactEmail",
    "value": "changed@email.com"
  }, {
    "name": "contactPhoneNumber",
    "value": "+49 (89) 45300-511"
  }, {
    "name": "nscAccess",
    "value": true
  }, {
    "name": "notes",
    "value": "Changed with API"
  }]
}
Then I should receive HTTP/1.1 204 No Content

Then given I am authenticated as operator C0002
When I send /api/system-integrators/S0123
Then I should receive HTTP/1.1 200 OK with body:
{
  "href": "/api/system-integrators/S0123",
  "links": [{
    "rel": "operator",
    "href": "/api/operators/C0002"
  }, {
    "rel": "defaultRatingProfile",
    "href": "/api/operators/C0002/rating-profiles/Another%20Profile"
  }, {
    "rel": "account",
    "href": "/api/accounts/123S0123"
  }, {
    "rel": "timezone",
    "href": "/api/time-zones/Europe.Berlin"
  }],
  "data": [{
    "name": "externalIdentifier",
    "value": "S0123"
  }, {
    "name": "name",
    "value": "Changed name"
  }, {
    "name": "contactName",
    "value": "Changed contact name"
  }, {
    "name": "contactEmail",
    "value": "changed@email.com"
  }, {
    "name": "contactPhoneNumber",
    "value": "+49 (89) 45300-511"
  }, {
    "name": "nscAccess",
    "value": true
  }, {
    "name": "cdrAccess",
    "value": false
  }, {
    "name": "notes",
    "value": "Changed with API"
  }, {
    "name": "password",
    "value": "***"
  }, {
    "name": "securityQuestion",
    "value": "question"
  }, {
    "name": "securityAnswer",
    "value": "answer"
  }]
}
Admin can change Operator for System Integrator
Given I am authenticated as Administrator
and there is System Integrator S0123 defined for Operator C0002
When I send /api/system-integrators/S0123 as application/json; charset=UTF-8
with following body:
{
  "links": [{
    "rel": "operator",
    "href": "/api/operators/C0003"
  }]
}
Then I should receive HTTP/1.1 204 No Content

Then given I am authenticated as Administrator
When I send /api/system-integrators/S0123
Then I should receive HTTP/1.1 200 OK with body:
{
  "href": "/api/system-integrators/S0123",
  "links": [{
    "rel": "operator",
    "href": "/api/operators/C0003"
  }, {
    "rel": "defaultRatingProfile",
    "href": "/api/operators/C0003/rating-profiles/Rating%20Profile%202"
  }]
}
Rating profile Operator must the same as in SystemIntegrator
Given I am authenticated as Administrator
and there is System Integrator S0123 defined for Operator C0002
and there is a rating profile Another Profile which is used by operator C0003
When I send /api/system-integrators/S0123 as application/json; charset=UTF-8
with following body:
{
  "links": [{
    "rel": "defaultRatingProfile",
    "href": "/api/operators/C0003/rating-profiles/Another%20Profile"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request with following body:
{
  "detail": "Rating Profile 'Another Profile' does not belong to Operator 'C0002'",
  "described_by": "http://api.nfon.net/probs/system-integrator-rating-profile-operator-not-match"
}
Not Admin cannot change Operator for System Integrator
Given I am authenticated as C0002
When I send /api/system-integrators/S0123 as application/json; charset=UTF-8
with following body:
{
  "links": [{
    "rel": "operator",
    "href": "/api/operators/C0003"
  }]
}
Then I should receive HTTP/1.1 403 Forbidden with following body:
{
  "detail": "Access denied to [SystemIntegrator] with id [S0123]",
  "title": "Access forbidden",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot change his data
Given I am authenticated as S0002
When I send /api/system-integrators/S0002 as application/json; charset=UTF-8
with following body:
{}
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"
}
Customer cannot change System Integrator data
Given I am authenticated as K0002
When I send /api/system-integrators/S0002 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 [SystemIntegrator] with id [S0002]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot change other System Integrator's data
Given I am authenticated as S0002
When I send /api/system-integrators/S0003 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 [SystemIntegrator] with id [S0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Operator cannot change data of System Integrator that does not belong to him
Given I am authenticated as C0002
When I send /api/system-integrators/S0003 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 [SystemIntegrator] with id [S0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Missing System Integrator
Given I am authenticated as Administrator
When I send /api/system-integrators/S0404 as application/json; charset=UTF-8
with following body:
{}
Then I should receive HTTP/1.1 404 Not Found with following body:
{
  "described_by": "http://api.nfon.net/probs/systemIntegrator-not-found",
  "title": "SystemIntegrator not found",
  "detail": "SystemIntegrator with identifier S0404 has not been found"
}