Api >

Service Portal REST API

POST assigns Skill Service to a Frontdesk Target
Given I am authenticated as Customer K0002
And there is a skill service with name: skill name and service number: 18
and there is a Frontdesk Service with service number: 17

When I send /api/customers/K0002/targets/frontdesk-services/17/target
as application/json; charset=UTF-8
with following body:
{
  "links": [{
    "rel": "targetService",
    "href": "/api/customers/K0002/targets/skill-services/18"
  }],
  "data": [{
    "name": "context",
    "value": "my random context for skill service"
  }]
}

Then I should receive HTTP/1.1 201 Created with http://localhost:9998/api/customers/K0002/targets/frontdesk-services/17/target/18
with following body:
{
  "href": "/api/customers/K0002/targets/frontdesk-services/17/target/18"
}
POST cannot create a Frontdesk Target with a service of another customer
Given I am authenticated as Customer K0002 And there is a skill service belonging to K0003 is created with name other skill name and service number 95.
and there is a Frontdesk Service with service number 17 When I send /api/customers/K0002/targets/frontdesk-services/17/target as application/json; charset=UTF-8 with following body:
{
  "links": [{
    "rel": "targetService",
    "href": "/api/customers/K0003/targets/skill-services/95"
  }],
  "data": [{
    "name": "context",
    "value": "my random context for queue service"
  }]
}
Then I should receive HTTP/1.1 403 Forbidden with following body:
{
  "detail": "Access denied to [Customer] with id [K0003]",
  "title": "Access forbidden",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
POST creates a Frontdesk Target
Given I am authenticated as Customer K0002
  • Queue Service Queue (service num. 23)
  • and there is a Frontdesk Service with service number 17 When I send /api/customers/K0002/targets/frontdesk-services/17/target as application/json; charset=UTF-8 with following body:
    {
      "links": [{
        "rel": "targetService",
        "href": "/api/customers/K0002/targets/queue-services/23"
      }],
      "data": [{
        "name": "context",
        "value": "my random context for queue service"
      }]
    }
    Then I should receive HTTP/1.1 201 Created with http://localhost:9998/api/customers/K0002/targets/frontdesk-services/17/target/23
    with following body:
    {
      "href": "/api/customers/K0002/targets/frontdesk-services/17/target/23"
    }

    Given I am authenticated as Customer K0002 And when I send /api/customers/K0002/targets/frontdesk-services/17/target/23
    I should receive HTTP/1.1 200 OK with body:
    {
      "href": "/api/customers/K0002/targets/frontdesk-services/17/target/23",
      "links": [{
        "rel": "targetService",
        "href": "/api/customers/K0002/targets/queue-services/23"
      }],
      "data": [{
        "name": "context",
        "value": "my random context for queue service"
      }]
    }
    POST assigns Phone extension to a Frontdesk Target
    Given I am authenticated as Customer K0002
    and there is a Phone Extension with extension number 45 and display name Phone Extension #45
    and there is a Frontdesk Service with service number: 17

    When I send /api/customers/K0002/targets/frontdesk-services/17/target
    as application/json; charset=UTF-8
    with following body:
    {
      "links": [{
        "rel": "targetService",
        "href": "/api/customers/K0002/targets/phone-extensions/45"
      }],
      "data": [{
        "name": "context",
        "value": "my random context for a phone extension"
      }]
    }

    Then I should receive HTTP/1.1 201 Created with http://localhost:9998/api/customers/K0002/targets/frontdesk-services/17/target/45
    with following body:
    {
      "href": "/api/customers/K0002/targets/frontdesk-services/17/target/45"
    }
    Given I am authenticated as Customer K0002 And when I send /api/customers/K0002/targets/frontdesk-services/17/target/45
    I should receive HTTP/1.1 200 OK with body:
    {
      "href": "/api/customers/K0002/targets/frontdesk-services/17/target/45",
      "links": [{
        "rel": "targetService",
        "href": "/api/customers/K0002/targets/phone-extensions/45"
      }],
      "data": [{
        "name": "context",
        "value": "my random context for a phone extension"
      }]
    }