Title: | Interacting with the ClickUp v2 API from R |
---|---|
Description: | Work with the ClickUp productivity app from R to manage tasks, goals, time tracking, and more. |
Authors: | Peter Solymos [aut, cre] , Kirill Müller [aut] |
Maintainer: | Peter Solymos <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.6 |
Built: | 2024-11-30 04:33:03 UTC |
Source: | https://github.com/psolymos/clickrup |
Result from a call to the API endpoint POST https://api.clickup.com/api/v2/task/task_id/attachment
cu_post_task_attachment( task_id, attachment, filename = NULL, ..., cu_token = NULL )
cu_post_task_attachment( task_id, attachment, filename = NULL, ..., cu_token = NULL )
task_id |
Task ID. |
attachment |
Path to a file. |
filename |
File name as it will show up in CluckUp,
deduced from |
... |
Can be used to pass mime |
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
A cu object.
cu for the cu object class.
## Not run: ## produce a png image f <- tempfile(fileext=".png") png(f) plot(1:10, col=1:10) dev.off() ## attache the image to a task cu_post_task_attachment("8ach57", f) unlink(f) # clean up the image ## End(Not run)
## Not run: ## produce a png image f <- tempfile(fileext=".png") png(f) plot(1:10, col=1:10) dev.off() ## attache the image to a task cu_post_task_attachment("8ach57", f) unlink(f) # clean up the image ## End(Not run)
These are the routes for authing the API and going through the OAuth flow. Applications utilizing the personal API token do not need these functions.
cu_get_access_token(client_id, client_secret, code, cu_token = NULL) cu_get_authorized_user(cu_token = NULL) cu_get_authorized_teams(cu_token = NULL)
cu_get_access_token(client_id, client_secret, code, cu_token = NULL) cu_get_authorized_user(cu_token = NULL) cu_get_authorized_teams(cu_token = NULL)
client_id |
Oauth app client id. |
client_secret |
Oauth app client secret. |
code |
Code given in redirect URL. |
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
A cu object.
cu for the cu object class.
Working with checklists in ClickUp tasks.
cu_create_checklist(task_id, name, cu_token = NULL) cu_edit_checklist(checklist_id, position, cu_token = NULL) cu_delete_checklist(checklist_id, cu_token = NULL) cu_create_checklist_item(checklist_id, name, ..., cu_token = NULL) cu_edit_checklist_item(checklist_id, checklist_item_id, ..., cu_token = NULL) cu_delete_checklist_item(checklist_id, checklist_item_id, cu_token = NULL)
cu_create_checklist(task_id, name, cu_token = NULL) cu_edit_checklist(checklist_id, position, cu_token = NULL) cu_delete_checklist(checklist_id, cu_token = NULL) cu_create_checklist_item(checklist_id, name, ..., cu_token = NULL) cu_edit_checklist_item(checklist_id, checklist_item_id, ..., cu_token = NULL) cu_delete_checklist_item(checklist_id, checklist_item_id, cu_token = NULL)
task_id |
Task ID. |
name |
Checklist or checlist item name. |
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
checklist_id |
Checklist ID. |
position |
Position is the zero-based index of the order you want the checklist to exist on the task. If you want the checklist to be in the first position, pass 0. |
... |
Named arguments to be passed to API request body, see the ClickUp API documentation (https://clickup.com/api). |
checklist_item_id |
Checklist item ID. |
A cu object.
cu for the cu object class.
## Not run: ## create new checklist cl <- cu_create_checklist("8ach57", "New checklist") ## change position of checklist cu_edit_checklist(cl$checklist$id, position = 0) ## create checklist items cli <- cu_create_checklist_item(cl$checklist$id, name="New item 1") cli <- cu_create_checklist_item(cl$checklist$id, name="New item 2", assignee = 4471793) cli <- cu_create_checklist_item(cl$checklist$id, name="New item 3", assignee = NA, resolved = TRUE, parent = NA) ## delete checklist items cu_delete_checklist_item(cli$checklist$id, cli$checklist$items[[1]]$id) ## delete checklist cu_delete_checklist(cli$checklist$id) ## End(Not run)
## Not run: ## create new checklist cl <- cu_create_checklist("8ach57", "New checklist") ## change position of checklist cu_edit_checklist(cl$checklist$id, position = 0) ## create checklist items cli <- cu_create_checklist_item(cl$checklist$id, name="New item 1") cli <- cu_create_checklist_item(cl$checklist$id, name="New item 2", assignee = 4471793) cli <- cu_create_checklist_item(cl$checklist$id, name="New item 3", assignee = NA, resolved = TRUE, parent = NA) ## delete checklist items cu_delete_checklist_item(cli$checklist$id, cli$checklist$items[[1]]$id) ## delete checklist cu_delete_checklist(cli$checklist$id) ## End(Not run)
Working with comments in ClickUp tasks.
cu_post_task_comment(task_id, ..., cu_token = NULL) cu_post_view_comment(view_id, ..., cu_token = NULL) cu_post_list_comment(list_id, ..., cu_token = NULL) cu_get_task_comments(task_id, cu_token = NULL) cu_get_view_comments(view_id, cu_token = NULL) cu_get_list_comments(list_id, cu_token = NULL) cu_put_update_comment(comment_id, ..., cu_token = NULL) cu_delete_comment(comment_id, cu_token = NULL)
cu_post_task_comment(task_id, ..., cu_token = NULL) cu_post_view_comment(view_id, ..., cu_token = NULL) cu_post_list_comment(list_id, ..., cu_token = NULL) cu_get_task_comments(task_id, cu_token = NULL) cu_get_view_comments(view_id, cu_token = NULL) cu_get_list_comments(list_id, cu_token = NULL) cu_put_update_comment(comment_id, ..., cu_token = NULL) cu_delete_comment(comment_id, cu_token = NULL)
task_id |
Task ID. |
... |
Named arguments to be passed to API request body, see the ClickUp API documentation (https://clickup.com/api). |
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
view_id |
View ID. |
list_id |
List ID. |
comment_id |
Comment ID. |
A cu object.
cu for the cu object class.
Working with custom fields in ClickUp tasks.
cu_get_accessible_custom_fields(list_id, cu_token = NULL) cu_set_custom_field_value(task_id, field_id, ..., cu_token = NULL) cu_remove_field_value(task_id, field_id, cu_token = NULL)
cu_get_accessible_custom_fields(list_id, cu_token = NULL) cu_set_custom_field_value(task_id, field_id, ..., cu_token = NULL) cu_remove_field_value(task_id, field_id, cu_token = NULL)
list_id |
List ID. |
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
task_id |
Task ID. |
field_id |
Field ID. |
... |
Named arguments to be passed to API request body.
The accessible fields can be found on the task object from the
|
A cu object.
cu for the cu object class.
Working dependencies xyz in ClickUp tasks (https://clickup.com/api).
cu_add_dependency(task_id, depends_on, dependency_of, cu_token = NULL) cu_delete_dependency(task_id, depends_on, dependency_of, cu_token = NULL) cu_add_task_link(task_id, links_to, cu_token = NULL) cu_delete_task_link(task_id, links_to, cu_token = NULL)
cu_add_dependency(task_id, depends_on, dependency_of, cu_token = NULL) cu_delete_dependency(task_id, depends_on, dependency_of, cu_token = NULL) cu_add_task_link(task_id, links_to, cu_token = NULL) cu_delete_task_link(task_id, links_to, cu_token = NULL)
task_id |
Task ID. |
depends_on |
A waiting on dependency of the task.
One and only one of |
dependency_of |
A blocking dependency of the task.
One and only one of |
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
links_to |
Link to another task. |
A cu object.
cu for the cu object class.
Working with folders in ClickUp tasks (https://clickup.com/api).
cu_create_folder(space_id, name, cu_token = NULL) cu_update_folder(folder_id, name, cu_token = NULL) cu_delete_folder(folder_id, name, cu_token = NULL) cu_get_folders(space_id, archived = FALSE, cu_token = NULL) cu_get_folder(folder_id, cu_token = NULL)
cu_create_folder(space_id, name, cu_token = NULL) cu_update_folder(folder_id, name, cu_token = NULL) cu_delete_folder(folder_id, name, cu_token = NULL) cu_get_folders(space_id, archived = FALSE, cu_token = NULL) cu_get_folder(folder_id, cu_token = NULL)
space_id |
Space ID. |
name |
Name of the folder. |
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
folder_id |
Folder ID. |
archived |
Logical, to return archived ( |
A cu object.
cu for the cu object class.
Working with goals in ClickUp tasks.
cu_create_goal(team_id, ..., cu_token = NULL) cu_update_goal(goal_id, ..., cu_token = NULL) cu_delete_goal(goal_id, cu_token = NULL) cu_get_goals(team_id, cu_token = NULL) cu_get_goal(goal_id, cu_token = NULL) cu_create_key_result(goal_id, ..., cu_token = NULL) cu_edit_key_result(key_result_id, ..., cu_token = NULL) cu_delete_key_result(key_result_id, cu_token = NULL)
cu_create_goal(team_id, ..., cu_token = NULL) cu_update_goal(goal_id, ..., cu_token = NULL) cu_delete_goal(goal_id, cu_token = NULL) cu_get_goals(team_id, cu_token = NULL) cu_get_goal(goal_id, cu_token = NULL) cu_create_key_result(goal_id, ..., cu_token = NULL) cu_edit_key_result(key_result_id, ..., cu_token = NULL) cu_delete_key_result(key_result_id, cu_token = NULL)
team_id |
Team ID. |
... |
Named arguments to be passed to API request body, see the ClickUp API documentation (https://clickup.com/api). |
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
goal_id |
Goal ID. |
key_result_id |
Key result ID. |
A cu object.
cu for the cu object class.
Working with guests in ClickUp tasks (Enterprise only feature).
cu_invite_guest_to_workspace(team_id, cu_token = NULL) cu_edit_guest_on_workspace(team_id, guest_id, ..., cu_token = NULL) cu_remove_guest_from_workspace(team_id, guest_id, cu_token = NULL) cu_get_guest(team_id, guest_id, cu_token = NULL) cu_add_guest_to_task( task_id, guest_id, permission_level = "read", cu_token = NULL ) cu_remove_guest_from_task(task_id, guest_id, cu_token = NULL) cu_add_guest_to_list( list_id, guest_id, permission_level = "read", cu_token = NULL ) cu_remove_guest_from_list(list_id, guest_id, cu_token = NULL) cu_add_guest_to_folder( folder_id, guest_id, permission_level = "read", cu_token = NULL ) cu_remove_guest_from_folder(folder_id, guest_id, cu_token = NULL)
cu_invite_guest_to_workspace(team_id, cu_token = NULL) cu_edit_guest_on_workspace(team_id, guest_id, ..., cu_token = NULL) cu_remove_guest_from_workspace(team_id, guest_id, cu_token = NULL) cu_get_guest(team_id, guest_id, cu_token = NULL) cu_add_guest_to_task( task_id, guest_id, permission_level = "read", cu_token = NULL ) cu_remove_guest_from_task(task_id, guest_id, cu_token = NULL) cu_add_guest_to_list( list_id, guest_id, permission_level = "read", cu_token = NULL ) cu_remove_guest_from_list(list_id, guest_id, cu_token = NULL) cu_add_guest_to_folder( folder_id, guest_id, permission_level = "read", cu_token = NULL ) cu_remove_guest_from_folder(folder_id, guest_id, cu_token = NULL)
team_id |
Team ID. |
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
guest_id |
Guest ID. |
... |
Named arguments to be passed to API request body, see the ClickUp API documentation (https://clickup.com/api). |
task_id |
Task ID. |
permission_level |
Permisson level can be
|
list_id |
List ID. |
folder_id |
Folder ID. |
A cu object.
cu for the cu object class.
Working with lists in ClickUp tasks.
cu_create_list(folder_id, ..., cu_token = NULL) cu_create_folderless_list(space_id, ..., cu_token = NULL) cu_update_list(list_id, ..., cu_token = NULL) cu_delete_list(list_id, ..., cu_token = NULL) cu_get_lists(folder_id, archived = FALSE, cu_token = NULL) cu_get_lists_folderless(space_id, archived = FALSE, cu_token = NULL) cu_get_list(list_id, cu_token = NULL)
cu_create_list(folder_id, ..., cu_token = NULL) cu_create_folderless_list(space_id, ..., cu_token = NULL) cu_update_list(list_id, ..., cu_token = NULL) cu_delete_list(list_id, ..., cu_token = NULL) cu_get_lists(folder_id, archived = FALSE, cu_token = NULL) cu_get_lists_folderless(space_id, archived = FALSE, cu_token = NULL) cu_get_list(list_id, cu_token = NULL)
folder_id |
Folder ID. |
... |
Named arguments to be passed to API request body, see the ClickUp API documentation (https://clickup.com/api). |
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
space_id |
SPace ID. |
list_id |
List ID. |
archived |
Logical, to return archived ( |
A cu object.
cu for the cu object class.
Working with members in ClickUp tasks (https://clickup.com/api).
cu_get_task_members(task_id, cu_token = NULL) cu_get_list_members(list_id, cu_token = NULL)
cu_get_task_members(task_id, cu_token = NULL) cu_get_list_members(list_id, cu_token = NULL)
task_id |
Task ID. |
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
list_id |
List ID. |
A cu object.
cu for the cu object class.
Working with spaces in ClickUp tasks.
cu_create_space(team_id, name, ..., cu_token = NULL) cu_update_space(space_id, ..., cu_token = NULL) cu_delete_space(space_id, cu_token = NULL) cu_get_spaces(team_id, archived = FALSE, cu_token = NULL) cu_get_space(space_id, cu_token = NULL)
cu_create_space(team_id, name, ..., cu_token = NULL) cu_update_space(space_id, ..., cu_token = NULL) cu_delete_space(space_id, cu_token = NULL) cu_get_spaces(team_id, archived = FALSE, cu_token = NULL) cu_get_space(space_id, cu_token = NULL)
team_id |
Team ID. |
name |
Name of the space. |
... |
Named arguments to be passed to API request body, see the ClickUp API documentation (https://clickup.com/api). |
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
space_id |
Space ID. |
archived |
Logical, to return archived ( |
A cu object.
cu for the cu object class.
Working with tags in ClickUp tasks.
cu_get_space_tags(space_id, cu_token = NULL) cu_create_space_tag(space_id, name, ..., cu_token = NULL) cu_edit_space_tag(space_id, tag_name, cu_token = NULL) cu_delete_space_tag(task_id, tag_name, cu_token = NULL) cu_add_tag_to_task(task_id, tag_name, cu_token = NULL) cu_delete_space_tag(task_id, tag_name, cu_token = NULL)
cu_get_space_tags(space_id, cu_token = NULL) cu_create_space_tag(space_id, name, ..., cu_token = NULL) cu_edit_space_tag(space_id, tag_name, cu_token = NULL) cu_delete_space_tag(task_id, tag_name, cu_token = NULL) cu_add_tag_to_task(task_id, tag_name, cu_token = NULL) cu_delete_space_tag(task_id, tag_name, cu_token = NULL)
space_id |
Space ID. |
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
name |
Tag name. |
... |
Named arguments to be passed to API request body, see the ClickUp API documentation (https://clickup.com/api). |
tag_name |
Tag name. |
task_id |
Task ID. |
A cu object.
cu for the cu object class.
Working with tasks in ClickUp tasks.
cu_create_task(list_id, ..., cu_token = NULL) cu_update_task(task_id, ..., cu_token = NULL) cu_delete_task(task_id, cu_token = NULL) cu_get_tasks(list_id, archived = FALSE, ..., cu_token = NULL) cu_get_task(task_id, cu_token = NULL) cu_get_filtered_team_tasks(team_id, ..., cu_token = NULL)
cu_create_task(list_id, ..., cu_token = NULL) cu_update_task(task_id, ..., cu_token = NULL) cu_delete_task(task_id, cu_token = NULL) cu_get_tasks(list_id, archived = FALSE, ..., cu_token = NULL) cu_get_task(task_id, cu_token = NULL) cu_get_filtered_team_tasks(team_id, ..., cu_token = NULL)
list_id |
List ID. |
... |
Named arguments to be passed to API request body, of as query parameters, see the ClickUp API documentation (https://clickup.com/api). |
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
task_id |
Task ID. The ClickUp GUI prepends task IDs with a leading hash, |
archived |
Logical, to return archived ( |
team_id |
Team (workspace) ID. |
assignees
is an array of the assignees' userids to be added to this task.
priority
is an integer mapping as 1 : Urgent, 2 : High, 3 : Normal, 4 : Low
(cu_priority()
). Time estimate is in milliseconds.
See the fields section below to see the custom fields available on a list.
If notify_all
is true, creation notifications will be sent to everyone
including the creator of the task. Instead of content you can pass
markdown_content
with valid markdown syntax to add formatting to the
task description. Passing an existing task ID in the parent property
will make the new task a subtask of that parent.
The parent you pass must not be a subtask itself,
and must be part of the list that you pass in the URL params.
The links_to
accepts a task ID to create a linked dependency on
the new task.
Only pass properties you want to update. It is unnecessary to pass the entire task object.
The maximum number of tasks returned in this response is 100.
When you are paging this request, you should check list limit against
the length of each response to determine if you are on the last page.
By default this does not include closed tasks. To page tasks,
pass the page number you wish to fetch. cu_get_all_team_tasks()
is a wrapper to spare paging.
When value is an array, use I()
to make sure atomic vectors
remain JSON arrays in the output.
archived: return archived tasks.
page: page to fetch (starts at 0)
order_by: order by field, defaults to created; options: id, created, updated, due_date.
reverse: reverse order.
subtasks: include subtasks, default false.
space_ids: spaces to query, array.
project_ids: projects to query, array.
statuses: statuses to query, array.
include_closed: by default, the api does not include closed tasks. Set this to true and don't send a status filter to include closed tasks.
assignees: assignees to query, array.
due_date_gt: filter due date greater than posix time.
due_date_lt: filter due date less than posix time.
date_created_gt: filter date created greater than posix time.
date_created_lt: filter date created less than posix time.
date_updated_gt: filter date updated greater than posix time.
date_updated_lt: filter date updated less than posix time
custom_fields: filter by custom fields. Must be a stringified JSON array of objects. See the custom fields section of the API docs for more details.
A cu object.
cu for the cu object class, cu_date_to()
and
cu_date_from()
to work with POSIX dates,
cu_get_all_team_tasks()
is a wrapper. cu_task_id()
to remove leading hashes from task IDs.
Working with task templates in ClickUp tasks.
cu_get_task_templates(team_id, page, cu_token = NULL) cu_create_task_from_template(list_id, template_id, name, ..., cu_token = NULL)
cu_get_task_templates(team_id, page, cu_token = NULL) cu_create_task_from_template(list_id, template_id, name, ..., cu_token = NULL)
team_id |
Team ID. |
page |
Page to fetch (starts at 0). To page task templates, pass the page number you wish to fetch. |
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
list_id |
List ID. |
template_id |
Template ID. |
name |
Name of the task. |
... |
Named arguments to be passed to API request body, see the ClickUp API documentation (https://clickup.com/api). |
A cu object.
cu for the cu object class.
Working with teams (workspaces) in ClickUp tasks (https://clickup.com/api). Teams is the legacy term for what are now called workspaces in ClickUp. For compatablitly, the term team is still used in the API v2. This is NOT the new 'Teams' feature which represents a group of users.
cu_get_teams(cu_token = NULL)
cu_get_teams(cu_token = NULL)
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
A cu object.
cu for the cu object class.
## Not run: cu_get_teams() ## End(Not run)
## Not run: cu_get_teams() ## End(Not run)
Working with time tracking in ClickUp tasks. Note: A time entry that has a negative duration means that timer is currently ongoing for that user.
cu_get_time_entries_within_date_range( team_id, start_date, end_date, assignee, cu_token = NULL ) cu_get_singular_time_entry(team_id, timer_id, cu_token = NULL) cu_get_time_entry_history(team_id, timer_id, cu_token = NULL) cu_get_running_time_entry(team_id, timer_id, cu_token = NULL) cu_create_time_entry(team_id, ..., cu_token = NULL) cu_remove_tags_from_time_entries(team_id, ..., cu_token = NULL) cu_get_all_tags_from_time_entries(team_id, cu_token = NULL) cu_add_tags_from_time_entries(team_id, ..., cu_token = NULL) cu_change_tag_names_from_time_entries(team_id, ..., cu_token = NULL) cu_start_time_entry(team_id, timer_id, ..., cu_token = NULL) cu_stop_time_entry(team_id, cu_token = NULL) cu_delete_time_entry(team_id, timer_id, cu_token = NULL) cu_update_time_entry(team_id, timer_id, ..., cu_token = NULL)
cu_get_time_entries_within_date_range( team_id, start_date, end_date, assignee, cu_token = NULL ) cu_get_singular_time_entry(team_id, timer_id, cu_token = NULL) cu_get_time_entry_history(team_id, timer_id, cu_token = NULL) cu_get_running_time_entry(team_id, timer_id, cu_token = NULL) cu_create_time_entry(team_id, ..., cu_token = NULL) cu_remove_tags_from_time_entries(team_id, ..., cu_token = NULL) cu_get_all_tags_from_time_entries(team_id, cu_token = NULL) cu_add_tags_from_time_entries(team_id, ..., cu_token = NULL) cu_change_tag_names_from_time_entries(team_id, ..., cu_token = NULL) cu_start_time_entry(team_id, timer_id, ..., cu_token = NULL) cu_stop_time_entry(team_id, cu_token = NULL) cu_delete_time_entry(team_id, timer_id, cu_token = NULL) cu_update_time_entry(team_id, timer_id, ..., cu_token = NULL)
team_id |
Team ID. |
start_date |
POSIX start time in milliseconds. |
end_date |
POSIX end time in milliseconds. |
assignee |
User ids to filter by separated by commas. Note: Only Workspace Owners/Admins have access to do this. |
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
timer_id |
Timer ID. |
... |
Named arguments to be passed to API request body, see the ClickUp API documentation (https://clickup.com/api). |
A cu object.
api-timetracking-legacy for Time tracking legacy API,
cu for the cu object class,
cu_date_from()
and cu_date_to()
to deal with POSIX times.
Working with time tracking in ClickUp tasks. Note: This is the legacy API for time tracking. Please use the new Time tracking API. You won't be able to update timer entries that uses our Time Tracking 2.0 features that uses labels, descriptions, and making time entries billable.
cu_track_time(task_id, ..., cu_token = NULL) cu_get_tracked_time(task_id, cu_token = NULL) cu_edit_time_tracked(task_id, interval_id, ..., cu_token = NULL) cu_delete_time_tracked(task_id, interval_id, cu_token = NULL)
cu_track_time(task_id, ..., cu_token = NULL) cu_get_tracked_time(task_id, cu_token = NULL) cu_edit_time_tracked(task_id, interval_id, ..., cu_token = NULL) cu_delete_time_tracked(task_id, interval_id, cu_token = NULL)
task_id |
Task ID. |
... |
Named arguments to be passed to API request body,
see the ClickUp API documentation (https://clickup.com/api).
Edit the |
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
interval_id |
Interval ID. |
A cu object. Note: the legacy API comes with a deprecation warning.
api-timetracking-2 for Time Tracking 2.0,
cu for the cu object class,
cu_date_from()
and cu_date_to()
to deal with POSIX times.
Working with users in ClickUp tasks (Enterprise only feture).
cu_invite_user_to_workspace( team_id, email, admin = FALSE, ..., cu_token = NULL ) cu_edit_user_on_workspace( team_id, user_id, username, admin = FALSE, ..., cu_token = NULL ) cu_remove_user_from_workspace(team_id, user_id, cu_token = NULL) cu_get_user(team_id, user_id, cu_token = NULL)
cu_invite_user_to_workspace( team_id, email, admin = FALSE, ..., cu_token = NULL ) cu_edit_user_on_workspace( team_id, user_id, username, admin = FALSE, ..., cu_token = NULL ) cu_remove_user_from_workspace(team_id, user_id, cu_token = NULL) cu_get_user(team_id, user_id, cu_token = NULL)
team_id |
Team (workspace) ID. |
email |
Email. |
admin |
Logical, admin account or not |
... |
Named arguments to be passed to API request body, see the ClickUp API documentation (https://clickup.com/api). |
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
user_id |
User ID. |
username |
User name. |
A cu object.
cu for the cu object class.
Working views in ClickUp tasks.
cu_create_team_view(team_id, name, ..., cu_token = NULL) cu_create_space_view(space_id, name, ..., cu_token = NULL) cu_create_folder_view(folder_id, name, ..., cu_token = NULL) cu_create_list_view(list_id, name, ..., cu_token = NULL) cu_get_team_views(team_id, cu_token = NULL) cu_get_space_views(space_id, cu_token = NULL) cu_get_folder_views(folder_id, cu_token = NULL) cu_get_list_views(list_id, cu_token = NULL) cu_get_view(view_id, cu_token = NULL) cu_get_view_tasks(view_id, page, cu_token = NULL) cu_update_view(view_id, ..., cu_token = NULL) cu_delete_view(view_id, cu_token = NULL)
cu_create_team_view(team_id, name, ..., cu_token = NULL) cu_create_space_view(space_id, name, ..., cu_token = NULL) cu_create_folder_view(folder_id, name, ..., cu_token = NULL) cu_create_list_view(list_id, name, ..., cu_token = NULL) cu_get_team_views(team_id, cu_token = NULL) cu_get_space_views(space_id, cu_token = NULL) cu_get_folder_views(folder_id, cu_token = NULL) cu_get_list_views(list_id, cu_token = NULL) cu_get_view(view_id, cu_token = NULL) cu_get_view_tasks(view_id, page, cu_token = NULL) cu_update_view(view_id, ..., cu_token = NULL) cu_delete_view(view_id, cu_token = NULL)
team_id |
Team (workspace) ID. |
name |
View name. |
... |
Named arguments to be passed to API request body, see the ClickUp API documentation (https://clickup.com/api). |
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
space_id |
Space ID. |
folder_id |
Folder ID. |
list_id |
List ID. |
view_id |
View ID. |
page |
Page to fetch (starts at 0). |
A cu object.
cu for the cu object class.
Working with webhooks in ClickUp tasks.
cu_create_webhook(team_id, endpoint, events = "*", ..., cu_token = NULL) cu_update_webhook(webhook_id, ..., cu_token = NULL) cu_delete_webhook(webhook_id, cu_token = NULL) cu_get_webhooks(team_id, cu_token = NULL)
cu_create_webhook(team_id, endpoint, events = "*", ..., cu_token = NULL) cu_update_webhook(webhook_id, ..., cu_token = NULL) cu_delete_webhook(webhook_id, cu_token = NULL) cu_get_webhooks(team_id, cu_token = NULL)
team_id |
Team ID. |
endpoint |
Webhook endpoint. |
events |
Events (see Details). |
... |
Named arguments to be passed to API request body,
e.g. |
cu_token |
ClickUp personal access token or an access token from the OAuth flow.
The |
webhook_id |
Webhook ID. |
You may filter the location of resources that get sent to a webhook
by passing an optional space_id
, folder_id
, list_id
, or
task_id
in the body of the request.
Without specifying any events, all event types
will be sent to the webhook. However, you can filter for specific
actions by sending an events array. To subscribe to specific events,
pass an array of events that you want to subscribe to,
otherwise pass "*"
to subscribe to everything.
Events include: "taskCreated"
"taskUpdated"
"taskDeleted"
"listCreated"
"listUpdated"
"listDeleted"
"folderCreated"
"folderUpdated"
"folderDeleted"
"spaceCreated"
"spaceUpdated"
"spaceDeleted"
"goalCreated"
"goalUpdated"
"goalDeleted"
"keyResultCreated"
"keyResultUpdated"
"keyResultDeleted"
.
A cu object.
cu for the cu object class. cu_task_id()
to remove leading hashes from task IDs.
Calls to the ClickUp API return objects of class cu. The obejct is a list based on the parsed JSON response from the call. The response is stored as an attribute. Methods are defined for better printing and coercion.
## S3 method for class 'cu' as.list(x, ...) ## S3 method for class 'cu' print(x, ...) ## S3 method for class 'cu' str(object, ...)
## S3 method for class 'cu' as.list(x, ...) ## S3 method for class 'cu' print(x, ...) ## S3 method for class 'cu' str(object, ...)
x |
An object of class cu. |
... |
Other optional arguments passed to methods. |
object |
An object of class cu. |
cu_response()
for retrieving the response attribute from a cu object.
cu_date_from
turns ClickUp date/time format (Unix time
in milliseconds) to POSIXct()
.
cu_date_to
turns a POSIXct coercible date/time value
back to Unix time.
cu_date_from(ms, tz = NULL, ...) cu_date_to(dt)
cu_date_from(ms, tz = NULL, ...) cu_date_to(dt)
ms |
ClickUp date/time format, Unix time in milliseconds. |
tz |
time zone, when |
... |
Other optional arguments passed to |
dt |
POSIXct coercible date/time value. |
cu_date_from
returns POSIXct()
.
cu_date_to
returns Unix time as character .
cu_options()
to set tz
globally.
## Not run: task_id <- "8ach57" due_date <- as.POSIXct("2020-12-24 21:15:49 MDT") task <- cu_get_task(task_id) task$due_date cu_date_to(due_date) task_up <- cu_update_task("8ach57", due_date=cu_date_to(due_date)) cu_date_from(task_up$due_date) identical(cu_date_from(task_up$due_date), due_date) ## End(Not run)
## Not run: task_id <- "8ach57" due_date <- as.POSIXct("2020-12-24 21:15:49 MDT") task <- cu_get_task(task_id) task$due_date cu_date_to(due_date) task_up <- cu_update_task("8ach57", due_date=cu_date_to(due_date)) cu_date_from(task_up$due_date) identical(cu_date_from(task_up$due_date), due_date) ## End(Not run)
The wrapper function uses cu_get_filtered_team_tasks()
but takes care of paging.
cu_get_all_team_tasks(team_id, ...)
cu_get_all_team_tasks(team_id, ...)
team_id |
Team ID of tasks. |
... |
All query parameters for |
A list parsed from the JSON response. The return object does not have a response attribute.
cu for the cu object class.
Options store and allow to set global values for the ClickUp API and for clickrup functions.
cu_options(...)
cu_options(...)
... |
Options to set. |
Options are mostly for internal use and to allow API version changes in the future.
The tz
(time zone) option can be set globally for cu_date_from()
.
The default value ""
means current time zone, see strptime()
.
When parameters are set by cu_options
, their former values are
returned in an invisible named list. Such a list can be passed as an
argument to cu_options
to restore the parameter values.
Tags are the following:
baseurl
: ClickUp API base URL.
version
: ClickUp API version.
tz
: time zone.
useragent
: user agent.
str(cu_options()) op <- cu_options(tz = "GMT") # save old values and set tz cu_options()$tz # new tz value cu_options(op) # reset cu_options()$tz # default tz value
str(cu_options()) op <- cu_options(tz = "GMT") # save old values and set tz cu_options()$tz # new tz value cu_options(op) # reset cu_options()$tz # default tz value
The ClickUp API requires a personal access token (PAT)
to be sent with each API request.
The cu_set_pat
function uses Sys.setenv
to set
the CU_PAT
environment variable for other processes
called from within R or future calls to Sys.getenv
from the same
R process. cu_get_pat
is used to retrieve the PAT for the API calls.
cu_get_pat(token = NULL) cu_set_pat(token)
cu_get_pat(token = NULL) cu_set_pat(token)
token |
ClickUp personal access token or an access token from the OAuth flow.
The |
To set up a ClickUp PAT, Follow this tutorial:
sign up for ClickUp (you can use this referral link to do so, it's free),
navigate to your personal Settings,
click Apps in the left sidebar,
click Generate to create your API token,
click Copy to copy the token to your clipboard.
Now add your ClickUp token as an environment variable:
open the file .Renviron
: file.edit("~/.Renviron")
,
add a line with CU_PAT="your_token"
to the .Renviron
file and save it,
check with Sys.getenv("CU_PAT")
, it should return the token.
cu_set_pat
returns logical similarly to Sys.setenv()
.
cu_get_pat
returns the ClickUp PAT that will look something like
pk_4753994_EXP7MPOJ7XQM5UJDV2M45MPF0YHH5YHO
.
When token
is not NULL
it will simply pass through the token value
and not look for the CU_PAT
environment variable.
The ClickUp API returns priority values as integer scores.
The cu_priority
function maps these scores to the priority labels
Urgent (1), High (2), Normal (3), Low (4).
cu_priority(score)
cu_priority(score)
score |
Character or numeric values between 1 and 4. |
Returns a character vector with the labels.
cu_priority(c(1, 2, 3, 4))
cu_priority(c(1, 2, 3, 4))
The ClickUp API is rate limited per OAuth/PAT token. You will receive a 429 HTTP status code if you exceed the rate limit. According to the API description (https://clickup.com/api), the rate limit is 100 requests per minute per token and is subject to change. At the time of writing, the limit is 900/min/token.
cu_ratelimit(x)
cu_ratelimit(x)
x |
A cu object returned by an API call. |
Returns a list with the following elements:
limit
: rate limit (per minute),
remaining
: remaining requests.
cu for the cu object class.
## Not run: task <- cu_get_task("8ach57") cu_ratelimit(task) ## End(Not run)
## Not run: task <- cu_get_task("8ach57") cu_ratelimit(task) ## End(Not run)
The function extracts the response attribute from a cu object after an ClickUp API call.
cu_response(x)
cu_response(x)
x |
An object of class cu. |
A response object as returned by httr::response()
.
Only calls to existing API endpoints return a response attribute.
Wrapper functions that make multiple calls to endpoints
(e.g. due to paging etc.) do not store the responses
and return NULL
.
httr::response()
for the response object,
and cu for the cu object class.
## Not run: task <- cu_get_task("8ach57") cu_response(task) ## End(Not run)
## Not run: task <- cu_get_task("8ach57") cu_response(task) ## End(Not run)
The ClickUp API returns role as integer.
The cu_role
function maps these scores to the priority labels
Owner (1), Admin (2), Member (3), Guest (4).
cu_role(role)
cu_role(role)
role |
Character or numeric values between 1 and 4. |
Returns a character vector with the labels.
cu_role(c(1, 2, 3, 4))
cu_role(c(1, 2, 3, 4))
Task IDs are prepended with a hash when copied from the ClickUp GUI. The function checks and removes the leading hash.
cu_task_id(task_id)
cu_task_id(task_id)
task_id |
Task ID with or without a leading hash. |
Returns task ID as character without leading hash to be used in the API.
cu_task_id("#7ygh8h") cu_task_id("7ygh8h")
cu_task_id("#7ygh8h") cu_task_id("7ygh8h")