Client

Client

JobCan Client

Constructor

new Client(optionsopt)

Initialize an object of Client
Source:
Parameters:
Name Type Attributes Description
options Object <optional>
Option parameters
Name Type Attributes Description
defaultHttpHeaders Object <optional>
Default http headers

Methods

auth(company_id, group_manager_id, password, callbackopt)

Execution of authentication
Source:
Parameters:
Name Type Attributes Description
company_id String Company ID of JobCan
group_manager_id String Group Manager ID of JobCan
password String Group Manager Password of JobCan
callback Client~authCallback <optional>
Callback function

getWorkStates(Optionsopt, callback)

Get the work states.
Source:
Parameters:
Name Type Attributes Description
Options Object <optional>
Optinal parameters
callback Client~getWorkStatesCallback Callback function

getWorkSummaries(Optionsopt, callback)

Get the work summaries.
Source:
Parameters:
Name Type Attributes Description
Options Object <optional>
Optinal parameters
callback Client~getWorkSummariesCallback Callback function

getWorkSummariesInPeriod(start_date, end_date, opt_optionsopt, callback)

Get a work summary of all employees in the period
Source:
Parameters:
Name Type Attributes Description
start_date Date Start date
end_date Date End date
opt_options Object <optional>
Optional paramters
callback Client~getWorkSummariesCallback Callback function

getWorkSummariesInPerm(start_date, end_date, opt_optionsopt, callback)

Get a work summary of all employees in the period
Deprecated:
Source:
Parameters:
Name Type Attributes Description
start_date Date Start date
end_date Date End date
opt_options Object <optional>
Optional paramters
callback Client~getWorkSummariesCallback Callback function

getWorkSummariesInThisMonth(opt_optionsopt, callback)

Get a work summary of all employees in this month
Source:
Parameters:
Name Type Attributes Description
opt_options Object <optional>
Optional paramters
callback Client~getWorkSummariesCallback Callback function

getWorkSummariesInThisWeek(opt_optionsopt, callback)

Get a work summary of all employees in this week
Source:
Parameters:
Name Type Attributes Description
opt_options Object <optional>
Optional paramters
callback Client~getWorkSummariesCallback Callback function

Type Definitions

authCallback(error, session_id)

Callback of auth(...) method
Source:
Parameters:
Name Type Description
error Error Error object (If something happened)
session_id String Session ID

getWorkStatesCallback(error, work_states)

Callback of getWorkStates(...) method
Source:
Parameters:
Name Type Description
error Error Error object (If something happened)
work_states Array.<Object> Array of work states
Name Type Description
name String Name of employee - e.g. 'Taro Tanaka'
groupName String Group name of employee - e.g. 'Head Office'
state String State of employee - e.g. '未出勤'
comeTime String Come time of employee - e.g. '10:00'
outTime String Out time of employee - e.g. '19:00'
workTime Number Working time (seconds) - e.g. 28800
breakTime Number Breaking time (seconds) - e.g. 3600
allowanceYen Number Allowance of employee (YEN) - e.g. 10500

getWorkSummariesCallback(error, work_summaries)

Callback of getWorkSummaries(...) method
Source:
Parameters:
Name Type Description
error Error Error object (If something happened)
work_summaries Array.<Object> Array of work summaries
Name Type Description
name String Name of employee - e.g. 'Taro Tanaka'
groupName String Group name of employee - e.g. 'Head Office'
workTime String Working time (seconds) - e.g. 28800
breakTime String Breaking time (seconds) - e.g. 3600
allowanceYen Number Allowance of employee (YEN) - e.g. 10500