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
| Parameter | Type | Description |
login | string (required) | Agent’s login |
password | string (required) | Agent’s password |
name | string (required) | Agent’s name that will be visible to clients |
alias | string (optional) | Agent’s alias |
gender | string (enum) | Agent’s gender – MALE or FEMALE. Default value: null |
supervisor | string (optional) | Login of the supervisor to whose group the agent belongs. You need this parameter to assign the agent to the supervisor’s group. |
role | string (required) | OPERATOR (only the OPERATOR role is supported) |
skills | array of long (optional) | Agent’s skills |
email | string (optional) | Agent’s email address |
photoUrl | string (optional) | Link to the agent’s photo |
settings | array 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"
}