diff --git a/R/api-attachments.R b/R/api-attachments.R index 66be01a..264231c 100644 --- a/R/api-attachments.R +++ b/R/api-attachments.R @@ -44,7 +44,7 @@ ## --form 'attachment=@/path/to/the/file/example.png' ## ... can be used to pass type argument to httr::upload_file -cu_post_task_attachment <- function(task_id, attachment, filename=NULL, ...) { +cu_post_task_attachment <- function(task_id, attachment, filename=NULL, ..., cu_token = NULL) { task_id <- cu_task_id(task_id) if (is.null(filename)) filename <- basename(attachment) @@ -52,7 +52,7 @@ cu_post_task_attachment <- function(task_id, attachment, filename=NULL, ...) { httr::modify_url(getOption("cu_options")$baseurl, path = .cu_path("task", task_id, "attachment")), httr::add_headers( - Authorization = cu_get_pat(), + Authorization = cu_get_pat(token = cu_token), "Content-Type" = "multipart/form-data"), httr::accept_json(), body=list(