Create Agents

Creates an agent. Note you can only create agents and supervisors (not admins). You need to use the OPERATOR role for all agents you create.

Permissions

  ----
  Permissions:INTEGRATOR,SUPERVISOR
  ----

Request Body Parameters

ParameterTypeDescription
loginstring (required)Agent’s login
passwordstring (required)Agent’s password
namestring (required)Agent’s name that will be visible to clients
aliasstring (optional)Agent’s alias
genderstring (enum)Agent’s gender – MALE or FEMALE. Default value: null
supervisorstring (optional)Login of the supervisor to whose group the agent belongs. You need this parameter to assign the agent to the supervisor’s group.
rolestring (required)OPERATOR (only the OPERATOR role is supported)
skillsarray of long (optional)Agent’s skills
emailstring (optional)Agent’s email address
photoUrlstring (optional)Link to the agent’s photo
settingsarray of objects (optional)Agent’s settings

Curl Example

$ curl 'http: //localhost:8080/api/v1/agents' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer <integrator_token>' \
    -d '{
  "login": "login",
  "password": "password",
  "name": "name",
  "alias": "alias",
  "gender": "MALE",
  "role": "OPERATOR",
  "skills": [
      1,
      2,
      3
    ],
  "photoUrl": "photo url",
  "email": "email",
  "settings": [],
  "supervisor": "supervisor1"
}'

HTTP Request

POST /api/v1/agents HTTP/1.1
Content-Type: application/json
Authorization: Bearer <integrator_token>
Content-Length: 240
Host: localhost: 8080
{
    "login": "login",
    "password": "password",
    "name": "name",
    "alias": "alias",
    "gender": "MALE",
    "role": "OPERATOR",
    "skills": [
        1,
        2,
        3
    ],
    "photoUrl": "photo url",
    "email": "email",
    "settings": [],
    "sipervisor": "supervisor1" 
}

Example of a Successful HTTP Response

HTTP/1.1 201 Created
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 38
{
    "id": 1,
    "login": "login"
}