Sync Employees

Method syncs actual list of employees into StartExam. Employees are added or updated automatically using identifiers from the corporate system.

Request Information

Scheme

POST https://api.startexam.com/v1/employees

URI Parameters

None

Body Parameters

Json with the SyncEmployeesQuery, containing Profile identifier from StartExam and list of Employees. Each Employee contains Id, Status and list of personal Data. See description and examples below.

  • ProfileId - Profile identifier from StartExam which should be used for fields validation. Can be found in account details at app.startexam.com.
  • Employee.Id - unique employee identifier at your organization. Can be card id, email, etc. Any string up to 250 chars. Query must never contain employees with same id.
  • Employee.Status - current employee status. Supported values: active - active at StartExam. hidden - inactive at StartExam.
  • Employee.Data.Name - personal data row name. Name must exist in specified Profile.
  • Employee.Data.Value - personal data row value. Value must be valid according to specified Profile.

Request Example

POST https://api.startexam.com/v1/employees HTTP/1.1
Host: api.startexam.com
Accept: application/json; charset=utf-8
Authorization: SharedKey 99:f52JP7GQd0xqrBzMO1NWTNVGzLENymgdUXu/Ie++NX4=
Content-Type: application/json; charset=utf-8
Content-Length: 744
Date: Sat, 30 Jan 2016 06:25:19 GMT

{
  "profileId": "d51b5efd-fb21-4cb8-94e2-145014839465",
  "employees": [
    {
      "id": "830507",
      "status": "active",
      "data": [
        {
          "name": "First Name",
          "value": "John"
        },
        {
          "name": "Last Name",
          "value": "Snow"
        },
        {
          "name": "Email",
          "value": "john.snow@gmail.com"
        }
      ]
    },
    {
      "id": "831411",
      "status": "hidden",
      "data": [
        {
          "name": "First Name",
          "value": "Charles"
        },
        {
          "name": "Last Name",
          "value": "Dickens"
        },
        {
          "name": "Email",
          "value": "dickens@hotmail.com"
        }
      ]
    }
  ]
}

Date and Authorization headers are constructed in the standard way.

Response Information

HTTP status code

200 OK, 400 Bad Request, etc. according the response processing guide.

Content-Type

Json.

Content

Synchronization results:

  • EmployeesCreated - number of newly added employees that hadn't exist in StartExam before.
  • EmployeesDataUpdated - number of employees that had existed in StartExam before and whose personal data was changed.
  • EmployeesStatusChangedToActive - number of employees whose status was changed to active.
  • EmployeesStatusChangedToHidden - number of employees whose status was changed to hidden.
  • EmployeesNotChanged - number of employees from query that had existed in StartExam before and whose data and status were not changed.

Response Example

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 162

{
  "employeesCreated": 2,
  "employeesDataUpdated": 0,
  "employeesStatusChangedToActive": 0,
  "employeesStatusChangedToHidden": 0,
  "employeesNotChanged": 0
}

Try Method