Api >

Service Portal REST API

PUT updates requested Conference Service's conference options
Test setup
Given there is a Conference Service with:
  • Id 123
  • display name Conference Service
  • extension 35
  • language de
  • musicIfSingleUser false
  • userPIN 3535
  • userSignalJoinLeave false
  • userAnnounceJoinsLeaves false
  • userAnnounceUserCount true
  • permanentlyMute false
  • adminPIN 3737
  • adminSignalJoinLeave false
  • adminAnnounceJoinsLeaves false
  • adminAnnounceUserCount false
  • closeAtExit true
  • lockUntilEntry true
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/conference-services/123 as application/json; charset=UTF-8 with following body:
{
  "data": [{
    "name": "displayName",
    "value": "New Conference Service"
  }, {
    "name": "extensionNumber",
    "value": "72"
  }, {
    "name": "language",
    "value": "fr"
  }, {
    "name": "musicIfSingleUser",
    "value": true
  }]
}
Then I should receive HTTP/1.1 204 No Content
Given I am authenticated as customer K0002
Then request /api/customers/K0002/targets/conference-services/123 should return
{
  "data": [{
    "name": "displayName",
    "value": "New Conference Service"
  }, {
    "name": "extensionNumber",
    "value": "72"
  }, {
    "name": "language",
    "value": "fr"
  }, {
    "name": "musicIfSingleUser",
    "value": true
  }]
}
PUT updates requested Conference Service's user options
Test setup
Given there is a Conference Service with:
  • Id 123
  • display name Conference Service
  • extension 35
  • language de
  • musicIfSingleUser false
  • userPIN 3535
  • userSignalJoinLeave false
  • userAnnounceJoinsLeaves false
  • userAnnounceUserCount true
  • permanentlyMute false
  • adminPIN 3737
  • adminSignalJoinLeave false
  • adminAnnounceJoinsLeaves false
  • adminAnnounceUserCount false
  • closeAtExit true
  • lockUntilEntry true
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/conference-services/123 as application/json; charset=UTF-8 with following body
{
  "data": [{
    "name": "userPIN",
    "value": "7373"
  }, {
    "name": "userSignalJoinLeave",
    "value": true
  }, {
    "name": "userAnnounceJoinsLeaves",
    "value": true
  }, {
    "name": "userAnnounceUserCount",
    "value": false
  }, {
    "name": "permanentlyMute",
    "value": true
  }]
}
Then I should receive HTTP/1.1 204 No Content
Given I am authenticated as customer K0002
Then request /api/customers/K0002/targets/conference-services/123 should return
{
  "data": [{
    "name": "userPIN",
    "value": "7373"
  }, {
    "name": "userSignalJoinLeave",
    "value": true
  }, {
    "name": "userAnnounceJoinsLeaves",
    "value": true
  }, {
    "name": "userAnnounceUserCount",
    "value": false
  }, {
    "name": "permanentlyMute",
    "value": true
  }]
}
PUT updates requested Conference Service's admin options
Test setup
Given there is a Conference Service with:
  • Id 123
  • display name Conference Service
  • extension 35
  • language de
  • musicIfSingleUser false
  • userPIN 3535
  • userSignalJoinLeave false
  • userAnnounceJoinsLeaves false
  • userAnnounceUserCount true
  • permanentlyMute false
  • adminPIN 3737
  • adminSignalJoinLeave false
  • adminAnnounceJoinsLeaves false
  • adminAnnounceUserCount false
  • closeAtExit true
  • lockUntilEntry true
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/conference-services/123 as application/json; charset=UTF-8 with following body
{
  "data": [{
    "name": "adminPIN",
    "value": "1212"
  }, {
    "name": "adminSignalJoinLeave",
    "value": true
  }, {
    "name": "adminAnnounceJoinsLeaves",
    "value": true
  }, {
    "name": "adminAnnounceUserCount",
    "value": true
  }, {
    "name": "closeAtExit",
    "value": false
  }, {
    "name": "lockUntilEntry",
    "value": false
  }]
}
Then I should receive HTTP/1.1 204 No Content
Given I am authenticated as customer K0002
Then request /api/customers/K0002/targets/conference-services/123 should return
{
  "data": [{
    "name": "adminPIN",
    "value": "1212"
  }, {
    "name": "adminSignalJoinLeave",
    "value": true
  }, {
    "name": "adminAnnounceJoinsLeaves",
    "value": true
  }, {
    "name": "adminAnnounceUserCount",
    "value": true
  }, {
    "name": "closeAtExit",
    "value": false
  }, {
    "name": "lockUntilEntry",
    "value": false
  }]
}
PUT does not update Conference Service's adminPIN with incorrect value
Test setup
Given there is a Conference Service with:
  • Id 123
  • display name Conference Service
  • extension 35
  • language de
  • musicIfSingleUser false
  • userPIN 3535
  • userSignalJoinLeave false
  • userAnnounceJoinsLeaves false
  • userAnnounceUserCount true
  • permanentlyMute false
  • adminPIN 3737
  • adminSignalJoinLeave false
  • adminAnnounceJoinsLeaves false
  • adminAnnounceUserCount false
  • closeAtExit true
  • lockUntilEntry true
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/conference-services/123 as application/json; charset=UTF-8 with following body:
{
  "data": [{
    "name": "adminPIN",
    "value": "incorrect value"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request with following body:
{
  "errors": [{
    "message": "Invalid PIN number format. PIN must be between 4 and 6 digits long",
    "path": "adminPIN",
    "value": "incorrect value"
  }]
}
Given I am authenticated as customer K0002
Then request /api/customers/K0002/targets/conference-services/123 should return
{
  "data": [{
    "name": "adminPIN",
    "value": "3737"
  }]
}
PUT does not update Conference Service's userPIN with incorrect value
Test setup
Given there is a Conference Service with:
  • Id 123
  • display name Conference Service
  • extension 35
  • language de
  • musicIfSingleUser false
  • userPIN 3535
  • userSignalJoinLeave false
  • userAnnounceJoinsLeaves false
  • userAnnounceUserCount true
  • permanentlyMute false
  • adminPIN 3737
  • adminSignalJoinLeave false
  • adminAnnounceJoinsLeaves false
  • adminAnnounceUserCount false
  • closeAtExit true
  • lockUntilEntry true
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/conference-services/123 as application/json; charset=UTF-8 with following body:
{
  "data": [{
    "name": "userPIN",
    "value": "incorrect value"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request with following body:
{
  "errors": [{
    "message": "Invalid PIN number format. PIN must be between 4 and 6 digits long",
    "path": "userPIN",
    "value": "incorrect value"
  }]
}
Given I am authenticated as customer K0002
Then request /api/customers/K0002/targets/conference-services/123 should return
{
  "data": [{
    "name": "userPIN",
    "value": "3535"
  }]
}
PUT does not update Conference Service's userPIN if it's equal to adminPIN
Test setup
Given there is a Conference Service with:
  • Id 123
  • display name Conference Service
  • extension 35
  • language de
  • musicIfSingleUser false
  • userPIN 3535
  • userSignalJoinLeave false
  • userAnnounceJoinsLeaves false
  • userAnnounceUserCount true
  • permanentlyMute false
  • adminPIN 3737
  • adminSignalJoinLeave false
  • adminAnnounceJoinsLeaves false
  • adminAnnounceUserCount false
  • closeAtExit true
  • lockUntilEntry true
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/conference-services/123 as application/json; charset=UTF-8 with following body:
{
  "data": [{
    "name": "userPIN",
    "value": "3737"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request with following body:
{
  "errors": [{
    "message": "Admin PIN and User PIN must not be the same"
  }]
}
Given I am authenticated as customer K0002
Then request /api/customers/K0002/targets/conference-services/123 should return
{
  "data": [{
    "name": "userPIN",
    "value": "3535"
  }]
}
PUT does not update Conference Service if display name contains invalid characters
Test setup
Given there is a Conference Service with:
  • Id 123
  • display name Conference Service
  • extension 35
  • language de
  • musicIfSingleUser false
  • userPIN 3535
  • userSignalJoinLeave false
  • userAnnounceJoinsLeaves false
  • userAnnounceUserCount true
  • permanentlyMute false
  • adminPIN 3737
  • adminSignalJoinLeave false
  • adminAnnounceJoinsLeaves false
  • adminAnnounceUserCount false
  • closeAtExit true
  • lockUntilEntry true
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/conference-services/123 as application/json; charset=UTF-8 with following body:
{
  "data": [{
    "name": "displayName",
    "value": "invalid display=name"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request with following body:
{
  "errors": [{
    "message": "Display name should not contain these characters: & $ ! ? = | \" { }",
    "path": "displayName",
    "value": "invalid display=name"
  }]
}
Given I am authenticated as customer K0002
Then request /api/customers/K0002/targets/conference-services/123 should return
{
  "data": [{
    "name": "displayName",
    "value": "Conference Service"
  }]
}
PUT does not update Conference Service with too long display name
Test setup
Given there is a Conference Service with:
  • Id 123
  • display name Conference Service
  • extension 35
  • language de
  • musicIfSingleUser false
  • userPIN 3535
  • userSignalJoinLeave false
  • userAnnounceJoinsLeaves false
  • userAnnounceUserCount true
  • permanentlyMute false
  • adminPIN 3737
  • adminSignalJoinLeave false
  • adminAnnounceJoinsLeaves false
  • adminAnnounceUserCount false
  • closeAtExit true
  • lockUntilEntry true
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/conference-services/123 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"
  }]
}
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"
  }]
}
Given I am authenticated as customer K0002
Then request /api/customers/K0002/targets/conference-services/123 should return
{
  "data": [{
    "name": "displayName",
    "value": "Conference Service"
  }]
}
PUT does not update Conference Service with invalid format of extension number
Test setup
Given there is a Conference Service with:
  • Id 123
  • display name Conference Service
  • extension 35
  • language de
  • musicIfSingleUser false
  • userPIN 3535
  • userSignalJoinLeave false
  • userAnnounceJoinsLeaves false
  • userAnnounceUserCount true
  • permanentlyMute false
  • adminPIN 3737
  • adminSignalJoinLeave false
  • adminAnnounceJoinsLeaves false
  • adminAnnounceUserCount false
  • closeAtExit true
  • lockUntilEntry true
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/conference-services/123 as application/json; charset=UTF-8 with following body:
{
  "data": [{
    "name": "extensionNumber",
    "value": "0123"
  }]
}
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"
  }]
}
Given I am authenticated as customer K0002
Then request /api/customers/K0002/targets/conference-services/123 should return
{
  "data": [{
    "name": "extensionNumber",
    "value": "35"
  }]
}
PUT does not update Conference Service with too long extension number
Test setup
Given there is a Conference Service with:
  • Id 123
  • display name Conference Service
  • extension 35
  • language de
  • musicIfSingleUser false
  • userPIN 3535
  • userSignalJoinLeave false
  • userAnnounceJoinsLeaves false
  • userAnnounceUserCount true
  • permanentlyMute false
  • adminPIN 3737
  • adminSignalJoinLeave false
  • adminAnnounceJoinsLeaves false
  • adminAnnounceUserCount false
  • closeAtExit true
  • lockUntilEntry true
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/conference-services/123 as application/json; charset=UTF-8 with following body:
{
  "data": [{
    "name": "extensionNumber",
    "value": "12345678901234567890123456789"
  }]
}
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"
  }]
}
Given I am authenticated as customer K0002
Then request /api/customers/K0002/targets/conference-services/123 should return
{
  "data": [{
    "name": "extensionNumber",
    "value": "35"
  }]
}
PUT does not update Conference Service with duplicated extension number
Test setup
Given there is a Conference Service with:
  • Id 123
  • display name Conference Service
  • extension 35
  • language de
  • musicIfSingleUser false
  • userPIN 3535
  • userSignalJoinLeave false
  • userAnnounceJoinsLeaves false
  • userAnnounceUserCount true
  • permanentlyMute false
  • adminPIN 3737
  • adminSignalJoinLeave false
  • adminAnnounceJoinsLeaves false
  • adminAnnounceUserCount false
  • closeAtExit true
  • lockUntilEntry true
Given I am authenticated as customer K0002
and there is already an extension with extension number 12345 When I send /api/customers/K0002/targets/conference-services/123 as application/json; charset=UTF-8 with following body:
{
  "data": [{
    "name": "extensionNumber",
    "value": "12345"
  }]
}
Then I should receive HTTP/1.1 400 Bad Request with following body:
{
  "errors": [{
    "message": "Extension number is not unique.",
    "path": "extensionNumber",
    "value": "12345"
  }]
}
Given I am authenticated as customer K0002
Then request /api/customers/K0002/targets/conference-services/123 should return
{
  "data": [{
    "name": "extensionNumber",
    "value": "35"
  }]
}
PUT does not update Conference Service with userAnnounceJoinsLeaves when userSignalJoinLeave is false
Test setup
Given there is a Conference Service with:
  • Id 123
  • display name Conference Service
  • extension 35
  • language de
  • musicIfSingleUser false
  • userPIN 3535
  • userSignalJoinLeave false
  • userAnnounceJoinsLeaves false
  • userAnnounceUserCount true
  • permanentlyMute false
  • adminPIN 3737
  • adminSignalJoinLeave false
  • adminAnnounceJoinsLeaves false
  • adminAnnounceUserCount false
  • closeAtExit true
  • lockUntilEntry true
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/conference-services/123 as application/json; charset=UTF-8 with following body:
{
  "data": [{
    "name": "userAnnounceJoinsLeaves",
    "value": true
  }]
}
Then I should receive HTTP/1.1 400 Bad Request with following body:
{
  "errors": [{
    "message": "Cannot set userAnnounceJoinsLeaves when userSignalJoinLeave is false",
    "path": "userAnnounceJoinsLeaves"
  }]
}
Given I am authenticated as customer K0002
Then request /api/customers/K0002/targets/conference-services/123 should return
{
  "data": [{
    "name": "userAnnounceJoinsLeaves",
    "value": false
  }]
}
PUT automatically update Conference Service with userAnnounceJoinsLeaves to false when userSignalJoinLeave is changed to false
Test setup
Given there is a Conference Service with:
  • Id 123
  • display name Conference Service
  • extension 35
  • language de
  • musicIfSingleUser false
  • userPIN 3535
  • userSignalJoinLeave false
  • userAnnounceJoinsLeaves false
  • userAnnounceUserCount true
  • permanentlyMute false
  • adminPIN 3737
  • adminSignalJoinLeave false
  • adminAnnounceJoinsLeaves false
  • adminAnnounceUserCount false
  • closeAtExit true
  • lockUntilEntry true
Given I am authenticated as customer K0002
and userSignalJoinLeave is set to true
and userAnnounceJoinsLeaves is set to true
When I send /api/customers/K0002/targets/conference-services/123 as application/json; charset=UTF-8 with following body:
{
  "data": [{
    "name": "userSignalJoinLeave",
    "value": false
  }]
}
Then I should receive HTTP/1.1 204 No Content
Given I am authenticated as customer K0002
Then request /api/customers/K0002/targets/conference-services/123 should return
{
  "data": [{
    "name": "userAnnounceJoinsLeaves",
    "value": false
  }, {
    "name": "userSignalJoinLeave",
    "value": false
  }]
}
PUT does not update Conference Service with adminAnnounceJoinsLeaves when adminSignalJoinLeave is false
Test setup
Given there is a Conference Service with:
  • Id 123
  • display name Conference Service
  • extension 35
  • language de
  • musicIfSingleUser false
  • userPIN 3535
  • userSignalJoinLeave false
  • userAnnounceJoinsLeaves false
  • userAnnounceUserCount true
  • permanentlyMute false
  • adminPIN 3737
  • adminSignalJoinLeave false
  • adminAnnounceJoinsLeaves false
  • adminAnnounceUserCount false
  • closeAtExit true
  • lockUntilEntry true
Given I am authenticated as customer K0002
When I send /api/customers/K0002/targets/conference-services/123 as application/json; charset=UTF-8 with following body:
{
  "data": [{
    "name": "adminAnnounceJoinsLeaves",
    "value": true
  }]
}
Then I should receive HTTP/1.1 400 Bad Request with following body:
{
  "errors": [{
    "message": "Cannot set adminAnnounceJoinsLeaves when adminSignalJoinLeave is false",
    "path": "adminAnnounceJoinsLeaves"
  }]
}
Given I am authenticated as customer K0002
Then request /api/customers/K0002/targets/conference-services/123 should return
{
  "data": [{
    "name": "adminAnnounceJoinsLeaves",
    "value": false
  }]
}
PUT automatically update Conference Service with adminAnnounceJoinsLeaves to false when adminSignalJoinLeave is changed to false
Test setup
Given there is a Conference Service with:
  • Id 123
  • display name Conference Service
  • extension 35
  • language de
  • musicIfSingleUser false
  • userPIN 3535
  • userSignalJoinLeave false
  • userAnnounceJoinsLeaves false
  • userAnnounceUserCount true
  • permanentlyMute false
  • adminPIN 3737
  • adminSignalJoinLeave false
  • adminAnnounceJoinsLeaves false
  • adminAnnounceUserCount false
  • closeAtExit true
  • lockUntilEntry true
Given I am authenticated as customer K0002
and adminSignalJoinLeave is set to true
and adminAnnounceJoinsLeaves is set to true
When I send /api/customers/K0002/targets/conference-services/123 as application/json; charset=UTF-8 with following body:
{
  "data": [{
    "name": "adminSignalJoinLeave",
    "value": false
  }]
}
Then I should receive HTTP/1.1 204 No Content
Given I am authenticated as customer K0002
Then request /api/customers/K0002/targets/conference-services/123 should return
{
  "data": [{
    "name": "adminAnnounceJoinsLeaves",
    "value": false
  }, {
    "name": "adminSignalJoinLeave",
    "value": false
  }]
}
Missing Customer
Test setup
Given there is a Conference Service with:
  • Id 123
  • display name Conference Service
  • extension 35
  • language de
  • musicIfSingleUser false
  • userPIN 3535
  • userSignalJoinLeave false
  • userAnnounceJoinsLeaves false
  • userAnnounceUserCount true
  • permanentlyMute false
  • adminPIN 3737
  • adminSignalJoinLeave false
  • adminAnnounceJoinsLeaves false
  • adminAnnounceUserCount false
  • closeAtExit true
  • lockUntilEntry true
Given I am authenticated as Admin
When I send /api/customers/K0404/targets/conference-services/123 as application/json; charset=UTF-8 with following body:
{}
Then I should receive HTTP/1.1 404 Not Found
And Content-Type header should be application/api-problem+json
with following body:
{
  "title": "Customer not found",
  "detail": "Customer with identifier K0404 has not been found",
  "described_by": "http://api.nfon.net/probs/customer-not-found"
}
PUT returns 403 if Customer is trying to update other Customer's Conference Services
Test setup
Given there is a Conference Service with:
  • Id 123
  • display name Conference Service
  • extension 35
  • language de
  • musicIfSingleUser false
  • userPIN 3535
  • userSignalJoinLeave false
  • userAnnounceJoinsLeaves false
  • userAnnounceUserCount true
  • permanentlyMute false
  • adminPIN 3737
  • adminSignalJoinLeave false
  • adminAnnounceJoinsLeaves false
  • adminAnnounceUserCount false
  • closeAtExit true
  • lockUntilEntry true
Given I am authenticated as K0003
When I send /api/customers/K0002/targets/conference-services/123 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 [Customer] with id [K0002]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot update Conference Service of Customer that does not belong to him
Test setup
Given there is a Conference Service with:
  • Id 123
  • display name Conference Service
  • extension 35
  • language de
  • musicIfSingleUser false
  • userPIN 3535
  • userSignalJoinLeave false
  • userAnnounceJoinsLeaves false
  • userAnnounceUserCount true
  • permanentlyMute false
  • adminPIN 3737
  • adminSignalJoinLeave false
  • adminAnnounceJoinsLeaves false
  • adminAnnounceUserCount false
  • closeAtExit true
  • lockUntilEntry true
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/targets/conference-services/123 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 [Customer] with id [K0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Operator cannot update Conference Service of Customer that does not belong to him
Test setup
Given there is a Conference Service with:
  • Id 123
  • display name Conference Service
  • extension 35
  • language de
  • musicIfSingleUser false
  • userPIN 3535
  • userSignalJoinLeave false
  • userAnnounceJoinsLeaves false
  • userAnnounceUserCount true
  • permanentlyMute false
  • adminPIN 3737
  • adminSignalJoinLeave false
  • adminAnnounceJoinsLeaves false
  • adminAnnounceUserCount false
  • closeAtExit true
  • lockUntilEntry true
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/conference-services/123 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 [Customer] with id [K0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}