ThinkR-open / togglr

an R and Rstudio wrapper for toggl Api
https://thinkr-open.github.io/togglr/
48 stars 18 forks source link

Get workspace IDs #23

Open svraka opened 4 years ago

svraka commented 4 years ago

As already noted by @VincentGuyader in a comment in get_workspace_id(), currently there's no way to query all workspace IDs from togglr.

As far as I understand, get_workspace_id() is used in many functions throughout the package to fetch the first workspace ID of an account which might not even be the default. Fortunately there's a me API endpoint, which returns info on all workspaces (similarly to the workspaces endpoint) but this also includes a field on which workspace is set as default.

I'm not sure what is the best approach to add this functionality to the packages. Without introducing significant braking changes, get_workspace_id() could gain a default_workspace argument, defaulting to TRUE (presumably most togglr users have only one workspace). However, the function name get_workspace_id() would be a bit misleading.

BTW, great package!