Description Usage Arguments Details Value References See Also Examples
Submits get requests to the Harvest API v2 with options configured for authentication, parallelism, and logging
1 2 3 4 5 6 7 8 9 10 11 12 13 | get_table(
table = NULL,
user = harvestR::get_harvest_account(),
key = harvestR::get_harvest_pat(),
query = NULL,
plan_options = NULL,
quiet = T,
...,
auto_retry = lifecycle::deprecated(),
email = lifecycle::deprecated(),
verbose = lifecycle::deprecated(),
strategy = lifecycle::deprecated()
)
|
table |
Character table name to be submitted to the Harvest API v2. Refer to Harvest API v2. |
user |
Character account number (e.g. user = '12345') for authentication. Register at Harvest Developers. Defaults to 'get_harvest_account()' |
key |
Character key (e.g. key = 'Bearer <secret key>') for API authentication. Register at Harvest Developers. Defaults to 'get_harvest_pat()' |
plan_options |
List; list of parameters passed to |
quiet |
Logical; controls harvestR messaging, TRUE returns only errors in the console and FALSE returns messages, warnings, and errors. Does not impact deprecation warnings. |
... |
Additional arguments forwarded to 'httr::RETRY()' and 'httr::config()'. Refer to details for more information. |
maturing
Description of ... parameters. Additional arguments are forwarded to config.
times
integer; Forwarded to RETRY, maximum number of requests to attempt. Defaults to 3.
token
httr-token; Forwarded to config, an OAuth token (1.0 or 2.0).
dataframe with contents of requested Harvest table
Harvest API v2 Harvest Developers Page, Future Pacakge Overview, Future Package Output
'future::plan()' for more detail regarding how to implement parallel api calls
'httr::httr_options()' for more detail regarding httr configurations
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ## Not run:
# Create a credentials record on the system keyring
create_harvest_creds()
# Set the credentials in the environment for get_table
set_harvest_creds()
# Barebones call to get_table
projects <- get_table(table = 'projects')
# Parallel request with 2 retries and messaging
# Windows users should use multisession, multicore will not work
time_entries <- get_table(table = 'time_entries',
query = list(from = '2018-01-01', to = '2018-12-31'),
plan_options = list(strategy = "multicore"),
times = 2,
quiet = F)
# Request using an httr option (see `httr::httr_options()`) and an oauth token
projects <- get_table(table = 'projects',
http_version = 2,
token = my_token)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.