Api >

Service Portal REST API

Customer should be able to create the Queue Service
Given I am authenticated as customer K0002
and there is an GENERAL_ANNOUNCEMENT announcement with ID 1010
and there is an MUSIC_ON_HOLD_QUEUE announcement with ID 1011, name anotherAnnouncement and file name filename.wav
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "links": [{
    "rel": "memberAnnouncement",
    "href": "/api/customers/K0002/announcements/1010"
  }, {
    "rel": "initialAnnouncement",
    "href": "/api/customers/K0002/announcements/1010"
  }, {
    "rel": "musicOnHoldAnnouncement",
    "href": "/api/customers/K0002/announcements/1011"
  }, {
    "rel": "periodicAnnouncement",
    "href": "/api/customers/K0002/announcements/1010"
  }],
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "INBOUND"
  }, {
    "name": "ringType",
    "value": "CUSTOM"
  }, {
    "name": "selectionStrategy",
    "value": "ROUND_ROBIN"
  }, {
    "name": "retryTimeout",
    "value": 11
  }, {
    "name": "memberTimeout",
    "value": 22
  }, {
    "name": "memberWrapUpTime",
    "value": 33
  }, {
    "name": "reportHoldTime",
    "value": true
  }, {
    "name": "periodicAnnouncementInterval",
    "value": 45
  }, {
    "name": "positionAnnouncementInterval",
    "value": 89
  }]
}
Then I should receive HTTP/1.1 201 Created
with http://localhost:9998/api/customers/K0002/targets/queue-services/0 and body:
{
  "href": "/api/customers/K0002/targets/queue-services/0"
}

Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services/0
Then I should receive HTTP/1.1 200 OK
{
  "href": "/api/customers/K0002/targets/queue-services/0",
  "links": [{
    "rel": "customer",
    "href": "/api/customers/K0002"
  }, {
    "rel": "destinationOnRejection",
    "href": "/api/customers/K0002/targets/queue-services/0/destination-on-rejection"
  }, {
    "rel": "memberAnnouncement",
    "href": "/api/customers/K0002/announcements/1010"
  }, {
    "rel": "initialAnnouncement",
    "href": "/api/customers/K0002/announcements/1010"
  }, {
    "rel": "periodicAnnouncement",
    "href": "/api/customers/K0002/announcements/1010"
  }, {
    "rel": "members",
    "href": "/api/customers/K0002/targets/queue-services/0/members"
  }, {
    "rel": "inboundTrunkNumbers",
    "href": "/api/customers/K0002/targets/queue-services/0/inbound-trunk-numbers"
  }, {
    "rel": "destinationOnTimeout",
    "href": "/api/customers/K0002/targets/queue-services/0/timeout"
  }, {
    "rel": "availableDestinationsOnRejection",
    "href": "/api/customers/K0002/targets/queue-services/available-destinations-on-rejection"
  }, {
    "rel": "availableDestinationsOnTimeout",
    "href": "/api/customers/K0002/targets/queue-services/available-destinations-on-timeout"
  }, {
    "rel": "availableGeneralAnnouncements",
    "href": "/api/customers/K0002/targets/queue-services/available-general-announcements"
  }, {
    "rel": "availableMusicOnHoldAnnouncements",
    "href": "/api/customers/K0002/targets/queue-services/available-music-on-hold-announcements"
  }, {
    "rel": "musicOnHoldAnnouncement",
    "href": "/api/customers/K0002/announcements/1011"
  }],
  "data": [{
    "name": "name",
    "value": "some display name"
  }, {
    "name": "serviceNumber",
    "value": 0
  }, {
    "name": "serviceCode",
    "value": "*770000"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "direction",
    "value": "INBOUND"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "ringType",
    "value": "CUSTOM"
  }, {
    "name": "selectionStrategy",
    "value": "ROUND_ROBIN"
  }, {
    "name": "retryTimeout",
    "value": 11
  }, {
    "name": "reportHoldTime",
    "value": true
  }, {
    "name": "memberTimeout",
    "value": 22
  }, {
    "name": "memberWrapUpTime",
    "value": 33
  }, {
    "name": "periodicAnnouncementInterval",
    "value": 45
  }, {
    "name": "positionAnnouncementInterval",
    "value": 89
  }]
}
Should create a Queue Service with default values
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "direction",
    "value": "INBOUND"
  }]
}
Then I should receive HTTP/1.1 201 Created
Given I am authenticated as customer K0002
When I ask for a skill /api/customers/K0002/targets/queue-services/0
Then I should receive HTTP/1.1 200 OK
And Content-Type header should be application/vnd.collection.next+json
with following body:
{
  "href": "/api/customers/K0002/targets/queue-services/0",
  "links": [{
    "rel": "customer",
    "href": "/api/customers/K0002"
  }],
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "direction",
    "value": "INBOUND"
  }, {
    "name": "weight",
    "value": 0
  }, {
    "name": "ringType",
    "value": "DEFAULT"
  }, {
    "name": "selectionStrategy",
    "value": "RING_ALL"
  }]
}
Should not create an outbound Queue Service with property 'periodicAnnouncementInterval' set
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "OUTBOUND"
  }, {
    "name": "periodicAnnouncementInterval",
    "value": 11
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Option cannot be set for Outbound QueueService",
    "path": "periodicAnnouncementInterval",
    "value": 11
  }]
}
Should not create an outbound Queue Service with property 'positionAnnouncementInterval' set
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "OUTBOUND"
  }, {
    "name": "positionAnnouncementInterval",
    "value": 11
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Option cannot be set for Outbound QueueService",
    "path": "positionAnnouncementInterval",
    "value": 11
  }]
}
Should not create an outbound Queue Service with property 'ringType' set
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "OUTBOUND"
  }, {
    "name": "ringType",
    "value": "RING"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Option cannot be set for Outbound QueueService",
    "path": "ringType",
    "value": "RING"
  }]
}
Should not create an outbound Queue Service with property 'selectionStrategy' set
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "OUTBOUND"
  }, {
    "name": "selectionStrategy",
    "value": "ROUND_ROBIN"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Option cannot be set for Outbound QueueService",
    "path": "selectionStrategy",
    "value": "ROUND_ROBIN"
  }]
}
Should not create an outbound Queue Service with property 'retryTimeout' set
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "OUTBOUND"
  }, {
    "name": "retryTimeout",
    "value": 11
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Option cannot be set for Outbound QueueService",
    "path": "retryTimeout",
    "value": 11
  }]
}
Should not create an outbound Queue Service with property 'reportHoldTime' set
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "OUTBOUND"
  }, {
    "name": "reportHoldTime",
    "value": true
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Option cannot be set for Outbound QueueService",
    "path": "reportHoldTime",
    "value": true
  }]
}
Should not create an outbound Queue Service with property 'memberTimeout' set
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "OUTBOUND"
  }, {
    "name": "memberTimeout",
    "value": 22
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Option cannot be set for Outbound QueueService",
    "path": "memberTimeout",
    "value": 22
  }]
}
Should not create an outbound Queue Service with property 'memberWrapUpTime' set
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "OUTBOUND"
  }, {
    "name": "memberWrapUpTime",
    "value": 33
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Option cannot be set for Outbound QueueService",
    "path": "memberWrapUpTime",
    "value": 33
  }]
}
Should not create an outbound Queue Service with link property 'initialAnnouncement' set
Given I am authenticated as customer K0002
and there is an GENERAL_ANNOUNCEMENT announcement with ID 1010
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "links": [{
    "rel": "initialAnnouncement",
    "href": "/api/customers/K0002/announcements/1010"
  }],
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "OUTBOUND"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Option cannot be set for Outbound QueueService",
    "path": "initialAnnouncement",
    "value": "/api/customers/K0002/announcements/1010"
  }]
}
Should not create an outbound Queue Service with link property 'periodicAnnouncement' set
Given I am authenticated as customer K0002
and there is an GENERAL_ANNOUNCEMENT announcement with ID 1010
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "links": [{
    "rel": "periodicAnnouncement",
    "href": "/api/customers/K0002/announcements/1010"
  }],
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "OUTBOUND"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Option cannot be set for Outbound QueueService",
    "path": "periodicAnnouncement",
    "value": "/api/customers/K0002/announcements/1010"
  }]
}
Should not create an outbound Queue Service with link property 'memberAnnouncement' set
Given I am authenticated as customer K0002
and there is an GENERAL_ANNOUNCEMENT announcement with ID 1010
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "links": [{
    "rel": "memberAnnouncement",
    "href": "/api/customers/K0002/announcements/1010"
  }],
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "OUTBOUND"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Option cannot be set for Outbound QueueService",
    "path": "memberAnnouncement",
    "value": "/api/customers/K0002/announcements/1010"
  }]
}
Should not create an outbound Queue Service with link property 'musicOnHoldAnnouncement' set
Given I am authenticated as customer K0002
and there is an MUSIC_ON_HOLD_QUEUE announcement with ID 1010
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "links": [{
    "rel": "musicOnHoldAnnouncement",
    "href": "/api/customers/K0002/announcements/1010"
  }],
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "OUTBOUND"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Option cannot be set for Outbound QueueService",
    "path": "musicOnHoldAnnouncement",
    "value": "/api/customers/K0002/announcements/1010"
  }]
}
Should not create aQueue Service with link property 'musicOnHoldAnnouncement' set to announcement with different type than 'MUSIC_ON_HOLD_QUEUE'
Given I am authenticated as customer K0002
and there is an GENERAL_ANNOUNCEMENT announcement with ID 1010
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "links": [{
    "rel": "musicOnHoldAnnouncement",
    "href": "/api/customers/K0002/announcements/1010"
  }],
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "INBOUND"
  }, {
    "name": "ringType",
    "value": "CUSTOM"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Expected musicOnHoldAnnouncement to be type of [MUSIC_ON_HOLD_QUEUE] but was [GENERAL_ANNOUNCEMENT]",
    "path": "musicOnHoldAnnouncement",
    "value": "/api/customers/K0002/announcements/1010"
  }]
}
Should not create a Queue Service with link property 'initialAnnouncement' set to announcement with different type than 'GENERAL_ANNOUNCEMENT'
Given I am authenticated as customer K0002
and there is an MUSIC_ON_HOLD_QUEUE announcement with ID 1010
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "links": [{
    "rel": "initialAnnouncement",
    "href": "/api/customers/K0002/announcements/1010"
  }],
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "INBOUND"
  }, {
    "name": "ringType",
    "value": "CUSTOM"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Expected initialAnnouncement to be type of [GENERAL_ANNOUNCEMENT] but was [MUSIC_ON_HOLD_QUEUE]",
    "path": "initialAnnouncement",
    "value": "/api/customers/K0002/announcements/1010"
  }]
}
Should not create a Queue Service with link property 'periodicAnnouncement' set to announcement with different type than 'GENERAL_ANNOUNCEMENT'
Given I am authenticated as customer K0002
and there is an MUSIC_ON_HOLD_QUEUE announcement with ID 1010
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "links": [{
    "rel": "periodicAnnouncement",
    "href": "/api/customers/K0002/announcements/1010"
  }],
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "INBOUND"
  }, {
    "name": "ringType",
    "value": "CUSTOM"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Expected periodicAnnouncement to be type of [GENERAL_ANNOUNCEMENT] but was [MUSIC_ON_HOLD_QUEUE]",
    "path": "periodicAnnouncement",
    "value": "/api/customers/K0002/announcements/1010"
  }]
}
Should not create a Queue Service without a 'displayName'
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "INBOUND"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Display name is missing",
    "path": "displayName"
  }]
}
Should not create a Queue Service using a displayName that contains invalid characters
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": "is this new name?"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "INBOUND"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
And Content-Type header should be application/api-problem+json
with following body:
{
  "errors": [{
    "message": "Display name should not contain these characters: & $ ! ? = | \" { }",
    "path": "displayName",
    "value": "is this new name?"
  }]
}
Should not create a Queue Service using a displayName with invalid length
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": "this is a way, way, way, way, way, way, way, way, way to long displayName"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "INBOUND"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Display name should have a length between 1 and 50 characters",
    "path": "displayName",
    "value": "this is a way, way, way, way, way, way, way, way, way to long displayName"
  }]
}
Should not create a Queue Service with duplicated displayName
Given I am authenticated as customer K0002
And there is a queue service
  • with name aDisplayName
  • with service number 345
  • and extension number 576
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": "aDisplayName"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "INBOUND"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Display name must be unique",
    "path": "displayName",
    "value": "aDisplayName"
  }]
}
Should create a Queue Service without 'extension number'
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": "name"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "INBOUND"
  }]
}
Then I should receive HTTP/1.1 201 Created
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services/0
Then I should receive HTTP/1.1 200 OK
Should not create a Queue Service using an extension number with invalid format
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": " displayName"
  }, {
    "name": "extensionNumber",
    "value": "0123"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "INBOUND"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Invalid extension number format. Must not start with the dial-out-prefix (default 0)",
    "path": "extensionNumber",
    "value": "0123"
  }]
}
Should not create a Queue Service using too long extension number
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": " displayName"
  }, {
    "name": "extensionNumber",
    "value": "12345678901234567890123456789"
  }, {
    "name": "weight",
    "value": 3
  }, {
    "name": "direction",
    "value": "INBOUND"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Extension number length should not exceed 20 characters",
    "path": "extensionNumber",
    "value": "12345678901234567890123456789"
  }]
}
Should not create a Queue Service using duplicate extension number
Given I am authenticated as customer K0002
and there is already an extension with extension number 12345 When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "extensionNumber",
    "value": "12345"
  }, {
    "name": "weight",
    "value": 0
  }, {
    "name": "direction",
    "value": "INBOUND"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Extension number is not unique.",
    "path": "extensionNumber",
    "value": "12345"
  }]
}
Should not create a Queue Service with invalid weight value
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "weight",
    "value": 1410
  }, {
    "name": "direction",
    "value": "INBOUND"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "Weight should have a value between 0 and 255",
    "path": "weight",
    "value": 1410
  }]
}
Should create a Queue Service with default timeout
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": "some display name"
  }, {
    "name": "direction",
    "value": "INBOUND"
  }]
}
Then I should receive HTTP/1.1 201 Created
Given I am authenticated as customer K0002
When I ask for a skill /api/customers/K0002/targets/queue-services/0/timeout
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/targets/queue-services/0/timeout",
  "data": [{
    "name": "timeoutDelay",
    "value": 0
  }]
}
Should not create a Queue Service with negative retryTimeout
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": "displayName"
  }, {
    "name": "direction",
    "value": "INBOUND"
  }, {
    "name": "retryTimeout",
    "value": -3
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "detail": "Could not create or update resource due to constraint violations",
  "title": "Validation error",
  "errors": [{
    "message": "must be non-negative",
    "path": "retryTimeout",
    "value": -3
  }],
  "described_by": "http://api.nfon.net/probs/validation-error"
}
Should not create a Queue Service with memberTimeout exceeding the limit
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": "displayName"
  }, {
    "name": "direction",
    "value": "INBOUND"
  }, {
    "name": "memberTimeout",
    "value": 1000000
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "detail": "Could not create or update resource due to constraint violations",
  "title": "Validation error",
  "errors": [{
    "message": "must be smaller than 1000",
    "path": "memberTimeout",
    "value": 1000000
  }],
  "described_by": "http://api.nfon.net/probs/validation-error"
}
Should not create a Queue Service with null memberWrapUpTime
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": [{
    "name": "displayName",
    "value": "displayName"
  }, {
    "name": "direction",
    "value": "INBOUND"
  }, {
    "name": "memberWrapUpTime",
    "value": null
  }]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
  "errors": [{
    "message": "memberWrapUpTime cannot be null",
    "path": "memberWrapUpTime",
    "value": null
  }]
}
Missing Customer
Given I am authenticated as Admin
When I send /api/customers/K404/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": []
}
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
  "title": "Customer not found",
  "detail": "Customer with identifier K404 has not been found",
  "described_by": "http://api.nfon.net/probs/customer-not-found"
}
Customer should not be able to create another Customer's queues
Given I am authenticated as Customer K0003
When I send /api/customers/K0002/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": []
}
Then I should receive HTTP/1.1 403 Forbidden
with following body:
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0002]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator should not be able to change data of a Customer that he cannot manage
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": []
}
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 should not be able to change data of a Customer that he cannot manage
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/queue-services
as application/json; charset=UTF-8
with following body:
{
  "data": []
}
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"
}