1.2.0 • Published 9 years ago

tsheets-client v1.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

tsheets-client

Simple client to the TSheets REST API, for time reporting etc.

Authentication

Set the environment variable NODE_TSHEETS_API_CLIENT_TOKEN to a TSheets access token.

API

reportTime(params, callback)

Reports time for a user, using the provided job code.

Params

ParameterDescriptionTypeRequired
api_tokenTSheets API token to use for the request.stringYes
user_idID of TSheets user to report time for.numberYes
jobcode_idTSheets job code ID.numberYes
duration_secondsTotal seconds to report on job code.numberYes
dateYYYY-MM-DD for the date to report time for.stringYes

getTimesheets(params, callback)

Gets timesheets for the specified user(s) for the provided time period.

Params

ParameterDescriptionTypeRequired
api_tokenTSheets API token to use for the request.stringYes
start_dateYYYY-MM-DD for the starting date.stringYes
end_dateYYYY-MM-DD for the end date.stringYes
user_idsArray of TSheets user IDs to get timesheets for.number[]No
pagePage number for timesheets (max 50 per page).numberNo