Api >

Service Portal REST API

GET list of Rating Profiles
Given I am authenticated as C0002
and there is rating profile with name 8 description description 8 which is assigned to operator C0002
and there is rating profile with name 58 description description 58 which is assigned to operator C0002
and there is rating profile with name 56 description description 56 which is assigned to operator C0003
When I send /api/operators/C0002/rating-profiles
Then I should receive HTTP/1.1 200 OK
with following body
{
  "href": "/api/operators/C0002/rating-profiles?_offset=0&_pagesize=16",
  "offset": 0,
  "total": 3,
  "size": 3,
  "links": [{
    "rel": "availableRatingProfiles",
    "href": "/api/operators/C0002/rating-profiles/available"
  }],
  "items": [{
    "href": "/api/operators/C0002/rating-profiles/58",
    "links": [],
    "data": [{
      "name": "name",
      "value": "58"
    }, {
      "name": "description",
      "value": "description 58"
    }]
  }, {
    "href": "/api/operators/C0002/rating-profiles/8",
    "links": [],
    "data": [{
      "name": "name",
      "value": "8"
    }, {
      "name": "description",
      "value": "description 8"
    }]
  }, {
    "href": "/api/operators/C0002/rating-profiles/Rating%20Profile%201",
    "links": [],
    "data": [{
      "name": "name",
      "value": "Rating Profile 1"
    }, {
      "name": "description",
      "value": "Rating Profile Description 1"
    }]
  }]
}
GET list of filtered Rating Profiles
Filtering is done on fields :
  • name
  • description
Given I am authenticated as C0002
and there is rating profile with name 8 description description 8 which is assigned to operator C0002
and there is rating profile with name 58 description description 58 which is assigned to operator C0002
and there is rating profile with name 12 description description 12 which is assigned to operator C0002
and there is rating profile with name 68 description description 68 which is assigned to operator C0003
When I send /api/operators/C0002/rating-profiles?_q=8
Then I should receive HTTP/1.1 200 OK
with following body
{
  "href": "/api/operators/C0002/rating-profiles?_offset=0&_pagesize=16&_q=8",
  "offset": 0,
  "total": 2,
  "size": 2,
  "links": [{
    "rel": "availableRatingProfiles",
    "href": "/api/operators/C0002/rating-profiles/available"
  }],
  "items": [{
    "href": "/api/operators/C0002/rating-profiles/58",
    "links": [],
    "data": [{
      "name": "name",
      "value": "58"
    }, {
      "name": "description",
      "value": "description 58"
    }]
  }, {
    "href": "/api/operators/C0002/rating-profiles/8",
    "links": [],
    "data": [{
      "name": "name",
      "value": "8"
    }, {
      "name": "description",
      "value": "description 8"
    }]
  }]
}
GET list of paged Rating Profiles
Given I am authenticated as C0002
and there is rating profile with name 8 description description 8 which is assigned to operator C0002
and there is rating profile with name 58 description description 58 which is assigned to operator C0002
When I send /api/operators/C0002/rating-profiles?_offset=2
Then I should receive HTTP/1.1 200 OK
with following body
{
  "href": "/api/operators/C0002/rating-profiles?_offset=2&_pagesize=16",
  "offset": 2,
  "total": 3,
  "size": 1,
  "links": [{
    "rel": "first",
    "href": "/api/operators/C0002/rating-profiles?_offset=0&_pagesize=16"
  }, {
    "rel": "prev",
    "href": "/api/operators/C0002/rating-profiles?_offset=0&_pagesize=16"
  }, {
    "rel": "last",
    "href": "/api/operators/C0002/rating-profiles?_offset=2&_pagesize=16"
  }, {
    "rel": "availableRatingProfiles",
    "href": "/api/operators/C0002/rating-profiles/available"
  }],
  "items": [{
    "href": "/api/operators/C0002/rating-profiles/Rating%20Profile%201",
    "links": [],
    "data": [{
      "name": "name",
      "value": "Rating Profile 1"
    }, {
      "name": "description",
      "value": "Rating Profile Description 1"
    }]
  }]
}
Fail meaningfully when getting rating profiles for not existing Operator
Given I am authenticated as Admin
When I ask for rating profiles for not existing Operator /api/operators/C404/rating-profiles
Then I should receive HTTP/1.1 404 Not Found
And Content-Type header should be application/api-problem+json
with following body:
{
  "detail": "Operator C404 has not been found",
  "title": "Operator not found",
  "described_by": "http://api.nfon.net/probs/operator-not-found"
}
Customer cannot access list of rating profiles
Given I am authenticated as customer K0002
When I ask for rating profiles /api/operators/C0002/rating-profiles
Then I should receive HTTP/1.1 403 Forbidden
And Content-Type header should be application/api-problem+json
with following body:
{
  "detail": "Access denied to [Operator] with id [C0002]",
  "title": "Access forbidden",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot access list of rating profiles
Given I am authenticated as System Integrator S0002
When I ask for rating profiles /api/operators/C0002/rating-profiles
Then I should receive HTTP/1.1 403 Forbidden
And Content-Type header should be application/api-problem+json
with following body:
{
  "detail": "Access denied to [Operator] with id [C0002]",
  "title": "Access forbidden",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}