API employee EN: различия между версиями

Материал из WiKi - UserSide
(Новая страница: «en | ru Section '''API''' ERP "UserSide"»)
 
Нет описания правки
 
Строка 2: Строка 2:


Section '''[[API_EN|API]]''' ERP "UserSide"
Section '''[[API_EN|API]]''' ERP "UserSide"
Purpose: Employees
Additional parameters:
action - request subcategory ''(possible value: see below)''
== Subcategories ==
==== add_notification ====
''Added in: 3.18beta1''
Description: Create a PUSH notification for an employee
Obligatory parameters:
  employee_id - employee ID
  body - text
Optional parameters:
  colour - HTML colour of the notification window
==== address_access_add ====
''Added in: 3.18beta1''
Description: Adds an address object to the available addresses for an employee
Obligatory parameters:
  employee_id - id of the employee
  address_id - id of address object ''(-1 for all addresses, -2 for objects without address)''.
  is_write - flag - write access
==== address_access_list ====
''Added in: 3.18beta1''
Description: List of available address objects for an employee
Obligatory parameters:
  employee_id - employee id
  is_write - flag - write access
==== address_access_remove ====
''Added in: 3.18beta1''
Description: Remove an address object from the available addresses for an employee
Obligatory parameters:
  employee_id - id of the employee
  address_id - id of address object ''(-1 for all addresses, -2 for objects without address)''
==== check_pass ====
''Added to: 3.16dev2''
Description: Checks if the username and password match to log into UserSide
Obligatory parameters:
  login - login
  pass - password
Since version 3.16.28, the employee's activity date is updated upon successful authentication
==== edit ====
''Added in: 3.18beta1''
Description: Edit employee record
Obligatory parameters:
  id - id of the employee
Optional parameters:
  date_birthday - date of birth
  date_in - date of employment
  date_out - date of resignation
  first_name - name
  gps_id - IMEI of gps-tracker
  middle_name - middle name
  last_name - surname
  position - position
  short_name - short name/surname
  messenger_chat_id - telegram/messenger chat_id
==== get_data ====
''Added in: 3.16dev2''
Description: Retrieve information about an employee
Optional parameters:
  id - id of the employee to sample ''(can be comma separated)''
==== get_division ====
''Added in: 3.16dev2''
Description: Retrieve information about a subdivision
Optional parameters:
  id - unit ID ''(can be comma separated)''
==== get_division_list ====
''Added in: 3.16dev2''
Description: List of units
==== get_employee_id ====
''Modified in: 3.18.7 (added possible messenger_chat_id value to data_typer parameter)''
''Added in: 3.16dev2''
Description: Retrieve employee ID from incoming data
Required parameters:
  data_typer - type of data we are checking ''(possible values: additional_field_XXX, name, login, messenger_chat_id)''
  data_value - value
==== get_history ====
''Modified in: 3.16dev6 (added object_id parameter)''
''Added in: 3.16dev2''
Description: Action history ''(limit 10000 records in sample results)''
Obligatory parameters:
  date_from - sampling start date ''(from)''
  date_to - sampling end date ''(to)''
Optional parameters:
  employee_id - employee id ''(can be comma separated)''
  type_id - id of action type ''(can be comma separated)''
  object_id - id of related object ''(can be comma separated)''
==== get_history_type ====
''Added in: 3.16dev2''
Description: History action types
Optional parameters:
  id - id of action type
==== get_timesheet_data ====
''Added in: 3.16dev2''
Description: Retrieve information from timesheets
Obligatory parameters:
  date_from - start date of sampling
  date_to - sampling end date
Optional parameters:
  employee_id - employee id ''(can be comma separated)''
  division_id - division id ''(can be comma separated)''
==== get_work_time_data ====
''Added in: 3.17dev1''
Description: Retrieve information about employees working hours
Obligatory parameters:
  date_from - start date of sampling
  date_to - date of sampling end
Optional parameters:
  employee_id - employee id ''(can be comma separated)''
==== get_unavailable_data ====
''Added in: 3.18beta1''
Description: Retrieve information about employee's ''(holiday, sick leave)'' unavailability
Obligatory parameters:
  None
Optional parameters:
  employee_id - employee id
  date_from - period start date
  date_to - end date of the period
==== set_timesheet_data ====
''Modified in: 3.17dev1 (changed value parameter logic)''
''Added in: 3.16dev2''
Description: Add/modify/delete an entry in the timesheet
Obligatory parameters:
  employee_id - employee id
  date - date
  type_id - id of record type ''(1 - basic time, 2 - overtime, 3 - other)''
  value - number of hours ''(after 3.17dev1: number of hours or text letter to mark non-working period, or empty value to delete the record; before 3.17dev1: integer value, or: 994 - on duty, 995 - off duty, 996 - holiday, 997 - day off, 998 - sick leave, 999 - business trip, or 0 to delete the record)''
==== set_unavailable_data ====
''Added in: 3.17dev1''
Description: Add/modify/delete employee unavailability record ''(holiday, sick leave)''
Obligatory parameters:
  employee_id - employee ID
  date_from - period start date
  date_to - period end date
Optional parameters:
  type_id - record type id ''(1 - holiday, 2 - sick leave, not filled - delete record)''
==== task_address_access_add ====
''Added in: 3.18beta1''
Description: Adds an address object to the list of addresses to which an employee can be assigned to work
Required parameters:
  employee_id - id of employee
  address_id - id of address object ''(-1 for all addresses, -2 for objects without address)''
==== task_address_access_list ====
''Added in: 3.18beta1''
Description: A list of addresses where an employee can be assigned to jobs
Obligatory parameters:
  employee_id - employee id
==== task_address_access_remove ====
''Added in: 3.18beta1''
Description: Removes an address object from the list of addresses to which an employee can be assigned to work
Obligatory parameters:
  employee_id - id of employee
  address_id - id of address object ''(-1 for all addresses, -2 for objects without address)''
==== work_time_finish ====
''Added to: 3.16dev5''
Description: Fixing the moment when the employee's working time ends
Obligatory parameters:
  employee_id - employee id
  date - date and time
Optional parameters:
  comment - notes
==== work_time_start ====
''Added to: 3.16dev5''
Description: Fixing the moment when the employee's working time starts
Obligatory parameters:
  employee_id - employee id
  date - date and time
Optional parameters:
  comment - notes

Текущая версия от 15:10, 11 августа 2023

en | ru

Section API ERP "UserSide"

Purpose: Employees

Additional parameters:
action - request subcategory (possible value: see below)

Subcategories

add_notification

Added in: 3.18beta1

Description: Create a PUSH notification for an employee
Obligatory parameters:
 employee_id - employee ID
 body - text
Optional parameters:
 colour - HTML colour of the notification window

address_access_add

Added in: 3.18beta1

Description: Adds an address object to the available addresses for an employee
Obligatory parameters:
 employee_id - id of the employee
 address_id - id of address object (-1 for all addresses, -2 for objects without address).
 is_write - flag - write access

address_access_list

Added in: 3.18beta1

Description: List of available address objects for an employee
Obligatory parameters:
 employee_id - employee id
 is_write - flag - write access

address_access_remove

Added in: 3.18beta1

Description: Remove an address object from the available addresses for an employee
Obligatory parameters:
 employee_id - id of the employee
 address_id - id of address object (-1 for all addresses, -2 for objects without address)

check_pass

Added to: 3.16dev2

Description: Checks if the username and password match to log into UserSide
Obligatory parameters:
 login - login
 pass - password

Since version 3.16.28, the employee's activity date is updated upon successful authentication

edit

Added in: 3.18beta1

Description: Edit employee record
Obligatory parameters:
 id - id of the employee
Optional parameters:
 date_birthday - date of birth
 date_in - date of employment
 date_out - date of resignation
 first_name - name
 gps_id - IMEI of gps-tracker
 middle_name - middle name
 last_name - surname
 position - position
 short_name - short name/surname
 messenger_chat_id - telegram/messenger chat_id

get_data

Added in: 3.16dev2

Description: Retrieve information about an employee
Optional parameters:
 id - id of the employee to sample (can be comma separated)

get_division

Added in: 3.16dev2

Description: Retrieve information about a subdivision
Optional parameters:
 id - unit ID (can be comma separated)

get_division_list

Added in: 3.16dev2

Description: List of units

get_employee_id

Modified in: 3.18.7 (added possible messenger_chat_id value to data_typer parameter)

Added in: 3.16dev2

Description: Retrieve employee ID from incoming data
Required parameters:
 data_typer - type of data we are checking (possible values: additional_field_XXX, name, login, messenger_chat_id)
 data_value - value

get_history

Modified in: 3.16dev6 (added object_id parameter)

Added in: 3.16dev2

Description: Action history (limit 10000 records in sample results)
Obligatory parameters:
 date_from - sampling start date (from)
 date_to - sampling end date (to)
Optional parameters:
 employee_id - employee id (can be comma separated)
 type_id - id of action type (can be comma separated)
 object_id - id of related object (can be comma separated)

get_history_type

Added in: 3.16dev2

Description: History action types
Optional parameters:
 id - id of action type

get_timesheet_data

Added in: 3.16dev2

Description: Retrieve information from timesheets
Obligatory parameters:
 date_from - start date of sampling
 date_to - sampling end date
Optional parameters:
 employee_id - employee id (can be comma separated)
 division_id - division id (can be comma separated)

get_work_time_data

Added in: 3.17dev1

Description: Retrieve information about employees working hours
Obligatory parameters:
 date_from - start date of sampling
 date_to - date of sampling end
Optional parameters:
 employee_id - employee id (can be comma separated)

get_unavailable_data

Added in: 3.18beta1

Description: Retrieve information about employee's (holiday, sick leave) unavailability
Obligatory parameters:
 None
Optional parameters:
 employee_id - employee id
 date_from - period start date
 date_to - end date of the period

set_timesheet_data

Modified in: 3.17dev1 (changed value parameter logic)

Added in: 3.16dev2

Description: Add/modify/delete an entry in the timesheet
Obligatory parameters:
 employee_id - employee id
 date - date
 type_id - id of record type (1 - basic time, 2 - overtime, 3 - other)
 value - number of hours (after 3.17dev1: number of hours or text letter to mark non-working period, or empty value to delete the record; before 3.17dev1: integer value, or: 994 - on duty, 995 - off duty, 996 - holiday, 997 - day off, 998 - sick leave, 999 - business trip, or 0 to delete the record)

set_unavailable_data

Added in: 3.17dev1

Description: Add/modify/delete employee unavailability record (holiday, sick leave)
Obligatory parameters:
 employee_id - employee ID
 date_from - period start date
 date_to - period end date
Optional parameters:
 type_id - record type id (1 - holiday, 2 - sick leave, not filled - delete record)

task_address_access_add

Added in: 3.18beta1

Description: Adds an address object to the list of addresses to which an employee can be assigned to work
Required parameters:
 employee_id - id of employee
 address_id - id of address object (-1 for all addresses, -2 for objects without address)

task_address_access_list

Added in: 3.18beta1

Description: A list of addresses where an employee can be assigned to jobs
Obligatory parameters:
 employee_id - employee id

task_address_access_remove

Added in: 3.18beta1

Description: Removes an address object from the list of addresses to which an employee can be assigned to work
Obligatory parameters:
 employee_id - id of employee
 address_id - id of address object (-1 for all addresses, -2 for objects without address)

work_time_finish

Added to: 3.16dev5

Description: Fixing the moment when the employee's working time ends 
Obligatory parameters:
 employee_id - employee id
 date - date and time
Optional parameters:
 comment - notes

work_time_start

Added to: 3.16dev5

Description: Fixing the moment when the employee's working time starts 
Obligatory parameters:
 employee_id - employee id
 date - date and time
Optional parameters:
 comment - notes