Git Product home page Git Product logo

clickup-client's Introduction

TestMonitor Clickup Client

Latest Stable Version CircleCI Travis Build Code Coverage Code Quality StyleCI License

This package provides a very basic, convenient, and unified wrapper for Clickup.

Table of Contents

Installation

To install the client you need to require the package using composer:

$ composer require testmonitor/clickup-client

Use composer's autoload:

require __DIR__.'/../vendor/autoload.php';

You're all set up now!

Usage

This client only supports oAuth authentication. You'll need an Clickup application to proceed. If you haven't done so, please read up with the Clickup authentication docs on how to create an application.

When your Clickup application is up and running, start with the oAuth authorization:

$oauth = [
    'clientId' => '12345',
    'clientSecret' => 'abcdef',
    'redirectUrl' => 'https://redirect.myapp.com/',
];

$clickup = new \TestMonitor\Clickup\Client($oauth);

header('Location: ' . $clickup->authorizationUrl());
exit();

This will redirect the user to a page asking confirmation for your app getting access to Clickup. Make sure your redirectUrl points back to your app. This URL should point to the following code:

$oauth = [
    'clientId' => '12345',
    'clientSecret' => 'abcdef',
    'redirectUrl' => 'https://redirect.myapp.com/',
];

$clickup = new \TestMonitor\Clickup\Client($oauth);

$token = $clickup->fetchToken($_REQUEST['code']);

When everything went ok, you should have an access token (available through Token object). It will be valid for one hour. After that, you'll have to refresh the token to regain access:

$oauth = ['clientId' => '12345', 'clientSecret' => 'abcdef', 'redirectUrl' => 'https://redirect.myapp.com/'];
$token = new \TestMonitor\Clickup\AccessToken('eyJ0...'); // the token you got last time

$clickup = new \TestMonitor\Clickup\Client($oauth, $token);

Examples

Get a list of Clickup workspaces:

$workspaces = $clickup->workspaces();

Or creating a task, for example (using list id 12345):

$workItem = $clickup->createTask(new \TestMonitor\Clickup\Resources\Task([
    'name' => 'Name of the task',
    'description' => 'Some description',
]), '12345');

Tests

The package contains integration tests. You can run them using PHPUnit.

$ vendor/bin/phpunit

Changelog

Refer to CHANGELOG for more information.

Contributing

Refer to CONTRIBUTING for contributing details.

Credits

License

The MIT License (MIT). Refer to the License for more information.

clickup-client's People

Contributors

thijskok avatar stefanius avatar frankisgek avatar stylecibot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.