Api >

Service Portal REST API

Admin should be able to read Operator's data
Given I am authenticated as Admin
And there is Operator C0002 with
  • name: Operator Name
  • contactName: Operator Contact
  • contactEmail: operator@example.com
  • contactPhone: +49 (22) 234-456
  • notes: Some notes
  • billingAccumulated: true
  • offlineBilling: true
  • salesForceAccountId: a062000000HbAsd
  • generateCdrs: true
  • ldapVisible: true
  • enableTps: true
  • defaultSystemIntegrator: S0002
  • defaultBlacklistProfile with ID 100
  • defaultPbxGroup: asterisk-1.8
  • domainName: nfon.net
  • snomLoginName: nfon
  • aastraLoginName: example@nfon.net
  • nmeeting: UNITS
  • nmeetingCustomerDefault: UNITS
  • nmeetingAfdDefault: true
  • minimumPasswordLength: 4
  • maximumPasswordLength: 8
  • voiceTrafficEncryption: true
  • defaultRatingProfile: 8
  • rdsHost: nfon.net
  • language: en
When I send /api/operators/C0002
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/operators/C0002",
  "links": [{
    "rel": "ratingProfiles",
    "href": "/api/operators/C0002/rating-profiles"
  }, {
    "rel": "defaultSystemIntegrator",
    "href": "/api/system-integrators/S0002"
  }, {
    "rel": "availableSystemIntegrators",
    "href": "/api/operators/C0002/system-integrators"
  }, {
    "rel": "defaultBlacklistProfile",
    "href": "/api/operators/C0002/blacklist-profiles/100"
  }, {
    "rel": "defaultRatingProfile",
    "href": "/api/operators/C0002/rating-profiles/8"
  }, {
    "rel": "availableBlacklistProfiles",
    "href": "/api/operators/C0002/blacklist-profiles"
  }, {
    "rel": "defaultPbxGroup",
    "href": "/api/operators/C0002/pbx-groups/asterisk-1.8"
  }, {
    "rel": "availablePbxGroups",
    "href": "/api/operators/C0002/pbx-groups"
  }, {
    "rel": "timezone",
    "href": "/api/time-zones/UTC"
  }],
  "data": [{
    "name": "name",
    "value": "Operator Name"
  }, {
    "name": "identifier",
    "value": "C0002"
  }, {
    "name": "contactName",
    "value": "Operator Contact"
  }, {
    "name": "contactEmail",
    "value": "operator@example.com"
  }, {
    "name": "contactPhone",
    "value": "+49 (22) 234-456"
  }, {
    "name": "mobileNumber",
    "value": "+49 (178) 1234567"
  }, {
    "name": "notes",
    "value": "Some notes"
  }, {
    "name": "billingAccumulated",
    "value": true
  }, {
    "name": "offlineBilling",
    "value": true
  }, {
    "name": "salesForceAccountId",
    "value": "a062000000HbAsd"
  }, {
    "name": "generateCdrs",
    "value": true
  }, {
    "name": "ldapVisible",
    "value": true
  }, {
    "name": "enableTps",
    "value": true
  }, {
    "name": "domainName",
    "value": "nfon.net"
  }, {
    "name": "snomLoginName",
    "value": "nfon"
  }, {
    "name": "aastraLoginName",
    "value": "example@nfon.net"
  }, {
    "name": "nmeeting",
    "value": "UNITS"
  }, {
    "name": "nmeetingCustomerDefault",
    "value": "UNITS"
  }, {
    "name": "nmeetingAfdDefault",
    "value": true
  }, {
    "name": "minimumPasswordLength",
    "value": 4
  }, {
    "name": "maximumPasswordLength",
    "value": 8
  }, {
    "name": "voiceTrafficEncryption",
    "value": true
  }, {
    "name": "rdsHost",
    "value": "nfon.net"
  }, {
    "name": "language",
    "value": "en"
  }, {
    "name": "nqmEnabled",
    "value": false
  }]
}
Customer cannot read Operator's data
Given I am authenticated as Customer K0002
When I send /api/operators/C0002
Then I should receive HTTP/1.1 403 Forbidden
with following body:
{
  "title": "Access forbidden",
  "detail": "Access denied to [Operator] with id [C0002]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot read Operator's data
Given I am authenticated as System Integrator S0002
When I send /api/operators/C0002
Then I should receive HTTP/1.1 403 Forbidden
with following body:
{
  "title": "Access forbidden",
  "detail": "Access denied to [Operator] with id [C0002]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Operator cannot read Operator's data
Given I am authenticated as Operator C0002
When I send /api/operators/C0002
Then I should receive HTTP/1.1 403 Forbidden
with following body:
{
  "title": "Access forbidden",
  "detail": "Required role is missing",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Admin cannot read not existing Operator's data
Given I am authenticated as Admin
And there is no Operator C0404 When I send /api/operators/C0404
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
  "title": "Operator not found",
  "detail": "Operator C0404 has not been found",
  "described_by": "http://api.nfon.net/probs/operator-not-found"
}