Create Supervisors

Creates a supervisor.

Permissions

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

Request Body Parameters

ParameterTypeDescription
loginstring (required)Supervisor’s login
passwordstring (required)Supervisor’s password
namestring (required)Supervisor’s name
genderstring (enum)Supervisor’s gender – MALE or FEMALE. Default value: null
unitstring (optional)ID of the organization unit to which the supervisor belongs. For this parameter, you can use any item added to the organization_units table.
emailstring (optional)Supervisor’s email address
photoUrlstring (optional)Link to the supervisor’s photo

Curl Example

$ curl 'http://localhost:8080/api/v1/supervisors' -i -X POST \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <integrator_token>' \
  -d '{
  "login" : "login",
  "password" : "password",
  "name" : "name",
  "gender" : "MALE",
  "photoUrl" : "photo url",
  "email" : "email",
  "unitId" : 1
}'

HTTP Request

POST /api/v1/supervisors HTTP/1.1
Content-Type: application/json
Authorization: Bearer <integrator_token>
Content-Length: 155
Host: localhost:8080
{
  "login" : "login",
  "password" : "password",
  "name" : "name",
  "gender" : "MALE",
  "photoUrl" : "photo url",
  "email" : "email",
  "unitId" : 1
}

Example of a Successful HTTP Response

HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 35
{
  "id" : 1,
  "login" : "login"
}