Documentation
¶
Overview ¶
Example (EstimateFutureTimeOffBalances) ¶
package main
import (
bamboohr "github.com/AkihikoITOH/bamboohr.go"
)
func main() {
conf := bamboohr.NewConfig("api-domain", "api-key")
api := bamboohr.NewAPI(conf)
api.EstimateFutureTimeOffBalances("12345", "2019-03-30")
}
Output:
Example (GetADirectoryOfEmployees) ¶
package main
import (
bamboohr "github.com/AkihikoITOH/bamboohr.go"
)
func main() {
conf := bamboohr.NewConfig("api-domain", "api-key")
api := bamboohr.NewAPI(conf)
api.GetADirectoryOfEmployees()
}
Output:
Example (GetAnEmployee) ¶
package main
import (
bamboohr "github.com/AkihikoITOH/bamboohr.go"
)
func main() {
conf := bamboohr.NewConfig("api-domain", "api-key")
api := bamboohr.NewAPI(conf)
api.GetAnEmployee("99999", []string{"firstName", "lastName"})
}
Output:
Example (GetTimeOffRequests) ¶
package main
import (
bamboohr "github.com/AkihikoITOH/bamboohr.go"
)
func main() {
conf := bamboohr.NewConfig("api-domain", "api-key")
api := bamboohr.NewAPI(conf)
filters := map[string]string{
"start": "2018-01-01",
"end": "2018-01-02",
"status": "approved",
}
api.GetTimeOffRequests(filters)
}
Output:
Example (WhosOut) ¶
package main
import (
bamboohr "github.com/AkihikoITOH/bamboohr.go"
)
func main() {
conf := bamboohr.NewConfig("api-domain", "api-key")
api := bamboohr.NewAPI(conf)
api.WhosOut("2018-01-01", "2019-03-31")
}
Output:
Index ¶
- Constants
- type API
- func (api *API) EstimateFutureTimeOffBalances(employeeID, endDate string) ([]*types.TimeOffBalance, error)
- func (api *API) GetADirectoryOfEmployees() (*types.EmployeeDirectory, error)
- func (api *API) GetAnEmployee(number string, fieldList []string) (*types.Employee, error)
- func (api *API) GetTimeOffRequests(filters map[string]string) ([]*types.TimeOffRequest, error)
- func (api *API) WhosOut(start, end string) ([]*types.TimeOff, error)
- type Config
Examples ¶
Constants ¶
const ( // BambooHRAPIHost is the API host name. BambooHRAPIHost = "api.bamboohr.com" // BambooHRAPIRootPath is the API root path. BambooHRAPIRootPath = "api/gateway.php" // BambooHRAPIVersion is the API version number. BambooHRAPIVersion = "v1" // DefaultTimeout is the duration for which it waits for the API to respond. DefaultTimeout = 10 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
API object contains the API configuration and has methods to communicate with the API.
func (*API) EstimateFutureTimeOffBalances ¶
func (api *API) EstimateFutureTimeOffBalances(employeeID, endDate string) ([]*types.TimeOffBalance, error)
EstimateFutureTimeOffBalances fetches a list of balances of various time offs for the employee at the given date. For more details, refer to https://www.bamboohr.com/api/documentation/time_off.php
func (*API) GetADirectoryOfEmployees ¶
func (api *API) GetADirectoryOfEmployees() (*types.EmployeeDirectory, error)
GetADirectoryOfEmployees fetches a list of employees. For more details, refer to https://www.bamboohr.com/api/documentation/employees.php
func (*API) GetAnEmployee ¶
GetAnEmployee fetches an employee with the given employee number from the BambooHR API. For more details, refer to https://www.bamboohr.com/api/documentation/employees.php
func (*API) GetTimeOffRequests ¶
GetTimeOffRequests fetches time off requests from the BambooHR API. For more details, refer to https://www.bamboohr.com/api/documentation/time_off.php