Skip to content

Latest commit

 

History

History
32 lines (27 loc) · 1.49 KB

File metadata and controls

32 lines (27 loc) · 1.49 KB

List Employees

require 'stackone_client'

Models = ::StackOne::Models
s = ::StackOne::StackOne.new(
  security: Models::Shared::Security.new(
    password: '',
    username: ''
  )
)

req = Models::Operations::HrisListEmployeesRequest.new(
  prefer: 'heartbeat',
  expand: 'company,employments,work_location,home_location,groups,skills',
  fields_: 'id,remote_id,title,first_name,last_name,name,display_name,gender,ethnicity,date_of_birth,birthday,marital_status,avatar_url,avatar,personal_email,personal_phone_number,work_email,work_phone_number,job_id,remote_job_id,job_title,job_description,department_id,remote_department_id,department,cost_centers,company,manager_id,remote_manager_id,hire_date,start_date,tenure,work_anniversary,employment_type,employment_contract_type,employment_status,termination_date,company_name,company_id,remote_company_id,preferred_language,citizenships,home_location,work_location,employments,custom_fields,created_at,updated_at,benefits,employee_number,national_identity_number,national_identity_numbers,bank_details,skills,unified_custom_fields',
  filter: Models::Operations::HrisListEmployeesQueryParamFilter.new(
    updated_after: DateTime.iso8601('2020-01-01T00:00:00.000Z')
  ),
  include: 'avatar_url,avatar,custom_fields,job_description,benefits,bank_details',
  x_account_id: '<id>'
)
res = s.hris.list_employees(request: req)

unless res.employees_paginated.nil?
  # handle response
end