edsol / php-clickup-api-client
ClickUp V2 API client (unofficial)
dev-main
2024-09-02 07:28 UTC
Requires
- php: >=5.6
- guzzlehttp/guzzle: ^6.3|^7.2
Requires (Dev)
- psy/psysh: ^0.9.8
This package is auto-updated.
Last update: 2025-01-02 09:33:27 UTC
README
Unofficial ClickUp API Client
see ClickUp Api Docs
Requirements
You need to have a ClickUp token, use official guide to create one
Install
composer require "edsol/clickup-php"
Implementations
Team
- Read
- get Spaces
Space
- Read
- get Tags
Folder
- Create
- Read
- Create List
Task
- Create
- Read
- Update
- Delete
- Add attachment/s
- Add assignee/s
- Get members
Comment
- Read
- Create
- Update
- Delete
Webhook
- List
- Create
- Update
- Delete
Usages
Initialize client
$clickup = new \ClickUpClient\Client('CLICK_UP_API_TOKEN');
Team
$clickup->team()->all(); $clickup->team()->spaces(); $clickup->team()->user('USER_ID');
Space
$clickup->space()->get("SPACE_ID"); $clickup->space('SPACE_ID')->tags(); $clickup->space('SPACE_ID')->folders(); $clickup->space('SPACE_ID')->folderlessLists();
Folder
$clickup->folder("SPACE_ID")->lists(); $clickup->folder("FOLDER_ID")->get(); $clickup->folder()->get("FOLDER_ID"); $clickup->folder("SPACE_ID")->create("FOLDER_NAME"); $clickup->folder("SPACE_ID")->createList("LIST_NAME");
List
$clickup->taskList("LIST_ID")->get(); $clickup->taskList("LIST_ID")->getTasks(); $clickup->taskList("LIST_ID")->comments(); $clickup->taskList("LIST_ID")->members(); $clickup->taskList("LIST_ID")->getCustomFields();
Task
$clickup->task("TASK_ID")->get(); $clickup->task("TASK_ID")->comments(); $clickup->task("TASK_ID")->members(); $clickup->task("TASK_ID")->add([ "name": "Updated Task Name", "description": "Updated Task Content", ]); $clickup->task("TASK_ID")->delete(); $clickup->task("TASK_ID")->update([ "name": "Updated Task Name", "description": "Updated Task Content" ]); $clickup->task("TASK_ID")->addAssignees([ MEMBER_ID_1, MEMBER_ID_2, ]); $clickup->task("TASK_ID")->addAssignee(MEMBER_ID); $attachment = new \ClickUpClient\Objects\Attachment([ 'contents' => \GuzzleHttp\Psr7\Utils::tryFopen('FILE_PATH', 'r'), 'filename' => 'filename.txt' ]); $clickup->task("TASK_ID")->addAttachment($attachment); $attachments = new \ClickUpClient\Objects\AttachmentCollection([ [ 'contents' => \GuzzleHttp\Psr7\Utils::tryFopen('FILE_PATH', 'r'), 'filename' => 'filename1.txt' ], [ 'contents' => \GuzzleHttp\Psr7\Utils::tryFopen('FILE_PATH', 'r'), 'filename' => 'filename2.txt' ], ]); $clickup->task("TASK_ID")->addAttachments($attachments); $clickup->task("TASK_ID")->setCustomField("FIELD_ID","NEW_FIELD_VALUE"); $clickup->task("TASK_ID")->deleteCustomField("FIELD_ID");
Comment
$clickup->comment('COMMENT_ID')->update([ 'comment_text' => "update comment text" ]); $clickup->comment()->deleteComment('COMMENT_ID');
Webhook
$clickup->team('TEAM_ID')->webhooks(); $clickup->team('TEAM_ID')->createWebhook([ 'endopint' => 'ENDPOINT_URL', 'events' => [ "taskCreated", "taskUpdated", "taskDeleted", ], ]); $clickup->webhook('WEBHOOK_ID')->updateWebhook([ 'endopint' => 'ENDPOINT_URL', 'events' => [ "taskCreated", "taskUpdated", "taskDeleted", ], ]); $clickup->webhook('WEBHOOK_ID')->delete();