Creating a user

Description: The method allows you to create a new user in the CC system

Method: POST

URL: /api/v1/users/exec.do

Query data:

escription of fields: * - required parameters

Field Value type Description
login * string(25) Login to log in to the user
roleId * integer(25) Specifies what role the user will be assigned to the system (roles must be pre-created in the admin panel) How to find out the roleId value
firstName * string(25) Username
lastName * string(25) User's last name
password * string(25) password for login to the system (must contain at least one uppercase letter, one lowercase and one digit)
skype string(25) Skype name
email string(255) mailbox
phone string(255) telephone number of the operator
internalPhoneId integer(25) The ID of the internal phone number to which the user must be linked in the How to find out internalPhoneId value
allowInternalPhoneEditing boolean A flag that indicates the ability to edit a user's internal phone number. Possible values: "true", "false"
userpic string(255) User avatar. Base 64 encoded text, png images less than 1 MB

Possible answers:
Upon successful request, the server will respond with HTTP status 201, and the data with the id of the created user: { "userId": 1 }

Examples of unsuccessful response (errors):
{"errorMessage":"login can't be empty"}
{"errorMessage":"firstName can't be empty"}
{"errorMessage":"lastName can't be empty"}
{"errorMessage":"Password must contain at least 1 lowercase and uppercase letter and at least 1 digit."}
{"errorMessage":"There is no pbxUserRole with such id"}
{"errorMessage":"InternalPhone with ID 1 is not found"}
{"errorMessage":"Incorrect email"}

 

 


Deleting a user

Description: The method allows removing the user from the CC system

Method: DELETE

URL: /api/v1/users/{userId}/exec.do

Description of values ​​in the query: * - required parameters

Field Value type Description
{userId} * integer() User Id on the system. How to find out the value of userId

Possible answers:
Upon successful request, the server will respond with an HTTP status 200 OK, data OK

Examples of unsuccessful response (errors):
{"errorMessage":"User with ID 0 not found"}
{"errorMessage":"You can't manipulate another group properties"}
{"errorMessage":"User with ID 0 not found"}

 

 


Retrieve user list

Description: The method returns a list of available users

Method: GET

URL: /api/v1/users.do?limit={limitN}&offset={offsetN}

Description of values ​​in the query: * - required parameters

Field Value type description
{limitN} * integer() The sample number of records in the query
{offsetN} * integer() The offset order when requesting from 0 to N

Possible answers:
Upon successful request, the server will respond with an HTTP status 200 OK, and a JSON array with user data

  [
    {
        "id": 1309,
        "login": "testcom_support",
        "password": null,
        "email": null,
        "firstName": "Testcom",
        "lastName": "Support",
        "skype": null,
        "phone": null,
        "roleId": 123,
        "userpic": null,
        "internalPhoneId": 819,
        "allowInternalPhoneEditing": false
    },
    {
        "id": 1427,
        "login": "study1_testcom",
        "password": null,
        "email": null,
        "firstName": "study1",
        "lastName": "study1",
        "skype": null,
        "phone": null,
        "roleId": 119,
        "userpic": null,
        "internalPhoneId": null,
        "allowInternalPhoneEditing": true
    }
  ]

 

 


Change user status

Description: A method for changing the current status of a user on the system

Method: PUT

URL: /api/v1/users/{userLogin}/statuses.json

Query data:

Description of values ​​in the query: * - required parameters

Field Value type description
{userLogin} * string() User login
status * string() The name of the status to which the user is to be transferred. Possible values ​​are: "READY", "NOT_READY"
statusTypeId integer The unique "NOT_READY" sub-status identifier. In other cases, it is ignored or not used.

Possible answers:
Upon successful request, the server will respond with an HTTP status 200 OK, and a response of OK

Examples of unsuccessful response (errors): status 500
{ "errorMessage": "Only 'READY' and 'NOT_READY' statuses allowed" }
{"errorMessage":"Unknown statusType or statusType id:21 is not in the group list of the user: manager"}

 

 


Adding a user to a group

Description: A method for adding an existing user to a group

Method: POST

URL: /api/v1/groups/{groupId}/users/exec.do

Query data:

Description of values ​​in the query: * - required parameters

Field Value type Description
{groupId} * integer() The ID of the group where you want to add the user. From where to get the value {groupId}
userId * integer() User ID on the system

Possible answers:
If successful, the server will respond with an HTTP status 201 Created, and a response of Created

Examples of unsuccessful response (errors):
{"errorMessage":"User 1 is already in group 2"}
{"errorMessage":"User with ID 1 not found"}
{"errorMessage":"Group with ID 1 not found"}

 

 


Get a list of all users who are assigned to a specific group

Description: The method allows you to get a list of all operators that are assigned to a specific group

Method: GET

URL: /api/v1/groups/{groupId}/users/all.json

Description of values ​​in the query: * - required parameters

Field Value type Description
{groupId} * integer() Group ID Where to get the value {groupId}

Possible answers:
Upon successful request, the server will respond with an HTTP status 200 OK, and a response


      [
          {
              "user": {
                  "id": 1477,
                  "login": "matula5991",
                  "firstName": "matula",
                  "lastName": "matula"
              },
              "userGroupStatus": {
                  "priority": 0,
                  "active": true
              }
          },
          {
              "user": {
                  "id": 1309,
                  "login": "testcom_support",
                  "firstName": "Testcom",
                  "lastName": "Support"
              },
              "userGroupStatus": {
                  "priority": 10,
                  "active": true
              }
          }
      ]

    

Examples of unsuccessful response (errors):
{ "errorMessage": "group with id [8391] do not exist" }

 

 


Get the priority value for a specific user in a given group

Description: The method allows you to get the highest priority for user tasks in the group

Method: GET

URL: /api/v1/groups/{groupId}/users/{userId}/status.json

Description of values ​​in the query: * - required parameters

Field Value type Description
{groupId} * integer() Group ID Where to get the value {groupId}
{userId} * integer() User ID on the system

Possible answers:
Upon successful request, the server will respond with an HTTP status 200 OK, and a response
{ "priority": 10, "active": true }

Examples of unsuccessful response (errors):
{"errorMessage":"group with id [1] do not exist"}
{"errorMessage":"user with id [77777] do not exist"}

 

 


Change the priority of a user in a group

Description: The method allows you to change the priority for the user in the group to the specified task

Method: PUT

URL: /api/v1/groups/{groupId}/tasks/{taskId}/prioritypolicies/exec.do

Query data:

Description of values ​​in the query: * - required parameters

Field Value type Description
{groupId}* integer() Group ID in which to change user priority. Where to get {groupId}
{taskId} * integer() ID of the task that was added to the group and for which the user should be prioritized. Where to get the value {taskId}
userId * integer() User ID on the system
priority * integer() Value of priority given. The value can be from -1 to N. (-1 eliminates user processing of a task in a group). The higher the number, the higher the priority of the user on the task.

Possible answers:
Upon successful request, the server will respond with an HTTP status 200 ОК, and a response of OK

Examples of unsuccessful response (errors):
{"errorMessage":"Group with ID 800 not found"}
{"errorMessage":"User with ID 5578 not found"}
{"errorMessage":"User with ID 3 not found within group 8"}
{"errorMessage":"Task with ID 800 is not found"}
{"errorMessage":"Task 7 is not found within group 8"}

 

 


Change many user priorities in a group

Description: The method allows you to change the priorities for many users in a group for the specified tasks with one request

Method: PUT

URL: /api/v1/priorities/exec.do

Query data:

Description of values ​​in the query: * - required parameters

Field Value type Description
groupId* integer() Group ID in which to change user priority Where to get {groupId}
taskId* integer() ID of the task that was added to the group and for which the user should be prioritized Where to get the value {taskId}
userId* integer() User ID on the system
priority* integer() Value of priority given. The value can be from -1 to N. (-1 eliminates user processing of a task in a group). The higher the number, the higher the priority of the user on the task.

Possible answers:
Upon successful request, the server will respond with an HTTP status 200 ОК, and respond with {}

Examples of unsuccessful response (errors):
{ "errors": [ { "groupId": 839, "taskId": 2845, "userId": 139, "priority": 10, "errorMsg": "User with ID 139 not found within group 839" } ] }

 

 


Removing a user from a group

Description: This method allows you to remove a user from a group

Method: DELETE

URL: /api/v1/groups/{groupId}/users/{userId}/exec.do

Description of values ​​in the query: * - required parameters

Field Value type Description
{groupId}* integer() Group ID from which to remove user From where to get {groupId}
{userId}* integer() User ID on the system

Possible answers:
Upon successful request, the server will respond with an HTTP status 200 ОК, and a response of OK

Examples of unsuccessful response (errors):
{"errorMessage":"User with ID 777 not found within group 88"}
{"errorMessage":"You can't manipulate another group properties"}
{"errorMessage":"User with ID 0 not found"}

 

 


Click-to-call

Description: Request to make a call to the specified client. In order to make a successful call, the operator must not be in one of the following statuses: OFFLINE, RESERVED, TALKING. The operator must have a REACHABLE phone number attached to it

Method: POST

URL: /api/v1/calls/exec.do

Query data:

Description of values ​​in the query: * - required parameters

Field Value type Description
userId * integer() User ID on the system
phoneNumber * string() The phone number to which the call is to be made (must be in the format supported by the routing of calls to the CC)

Possible answers:
Upon successful request, the server will respond with an HTTP status 200 ОК, and a response of OK

Examples of unsuccessful response (errors):
{ "errorMessage": "Phone Not Available" }