PHPackages                             imper86/php-asana-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. imper86/php-asana-api

ActiveLibrary

imper86/php-asana-api
=====================

Simple and cool PHP Asana API client

v2.0.4(6y ago)058MITPHPPHP ^7.1

Since Feb 17Pushed 6y ago1 watchersCompare

[ Source](https://github.com/imper86/php-asana-api)[ Packagist](https://packagist.org/packages/imper86/php-asana-api)[ RSS](/packages/imper86-php-asana-api/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

Asana API PHP SDK
=================

[](#asana-api-php-sdk)

Installation
------------

[](#installation)

Just use composer:

```
composer require imper86/php-asana-api
```

Authentication
--------------

[](#authentication)

Library has a bunch of mechanisms that allows you to forget about tokens, expirations etc. But in order to start using it you must authorize user using Oauth flow.

Create Credentials object:

```
$credentials = new Credentials(
    'your_client_id',
    'your_client_secret',
    'http://localhost:8000/asana' //redirect_uri
);
```

Create TokenRepository object:

```
$tokenRepository = new FileTokenRepository(__DIR__ . '/asana_tokens');
```

You can invent your own TokenRepository, just implement [TokenRepositoryInterface](src/Service/TokenRepositoryInterface.php). You can use your DB, Redis, or anything you want.

Create client:

```
$client = new Client($credentials, $tokenRepository);
```

Get the authorization URL, and redirect your user:

```
$state = 'your-random-secret-state';
header(sprintf('Location: %s', $client->auth()->authUri($state)));
```

After successfull authorization, user will be redirected to your **redirect\_uri** with *state* and *code* parameters.

Verify the state and authenticate your Client:

```
if ($state === $_GET['state'] ?? null) {
    throw new Exception('CSRF?!');
}

$client->authenticateWithCode($_GET['code']);
```

Library will use your TokenRepository to store the token, and from now on you should only care about storing user's Asana gid.

You can get that id with:

```
$client->getUserGid();
```

Usage
-----

[](#usage)

Just like in Auth part, create client:

```
$userGid = 'your-user-gid';
$client = new Client($credentials, $tokenRepository, $userGid);
```

From now you can use these methods on $client:

```
$client->organizations()->(...)
$client->projects()->(...)
$client->sections()->(...)
$client->tags()->(...)
$client->tasks()->(...)
$client->teams()->(...)
$client->users()->(...)
$client->workspaces()->(...)
```

Fast example:

```
$projects = $client->teams()->projects()->list('teamgid');
```

CRUD operations naming:

- list() - GET collection
- show() - GET item
- remove() - DELETE item
- update() - PUT item

If you use IDE with typehinting such as PHPStorm, you'll easily figure it out. If not, please [take a look in Resource directory](src/Resource)

Contributing
------------

[](#contributing)

Any help will be very appreciated.

This library is not finished, not all resources are covered. x

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~87 days

Total

2

Last Release

2192d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/aedc51c5ea25d6520027720f9a5599e171e95a47102b66ffd929427f95317561?d=identicon)[imper86](/maintainers/imper86)

---

Top Contributors

[![imper86](https://avatars.githubusercontent.com/u/16724155?v=4)](https://github.com/imper86 "imper86 (2 commits)")

### Embed Badge

![Health badge](/badges/imper86-php-asana-api/health.svg)

```
[![Health](https://phpackages.com/badges/imper86-php-asana-api/health.svg)](https://phpackages.com/packages/imper86-php-asana-api)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
