Download the PHP package tristan/asana without Composer

On this page you can find all versions of the php package tristan/asana. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package asana

Asana PHP API

Build Status Packagist Version

The maintained replacement for the official Asana PHP client.

asana/asana no longer installs. Every published version of the official package (v0.1 through v1.0.6) requires nategood/httpful ~0.2, and every version matching that constraint is covered by security advisory PKSA-4dtf-ym9h-t41j — those releases default TLS certificate verification to off. Composer's default policy refuses to install them, so composer require asana/asana now fails outright:

Asana merged a fix permitting httpful 1.0 in October 2024 but never tagged a release containing it, and discontinued support for the package in January 2025. This fork has removed nategood/httpful entirely — see below.

This fork is a drop-in replacement: same Asana\ namespace, same public API, same endpoint surface. It adds PHP 8.1+ support, a repaired development toolchain, and CI across PHP 8.1–8.5.

As of this release, the library sends every request through a PSR-18 HTTP client rather than nategood/httpful. Any PSR-18 client works: php-http/discovery automatically finds and uses whichever one your application already has installed (Guzzle, Symfony HttpClient, ...). If none is present, the library falls back to a small bundled curl-backed client (Asana\Http\CurlHttpClient) so it still works standalone. See examples/example-psr18-http-client.php for how to choose or inject a specific client, and examples/example-psr7-messages.php for decorating the PSR-7 request/response objects. The client is exposed as the public $dispatcher->httpClient property, which tests and applications alike may set directly. An endpoint surface regenerated from Asana's published OpenAPI specification is still planned for a future release; this one's endpoint surface remains byte-identical to upstream's.

Installation

If your project has no PSR-18 client installed already, add one — Guzzle is the most common choice:

The namespace remains Asana\, so existing code needs no changes.

This package declares replace: {"asana/asana": "*"}, which means it also satisfies asana/asana requirements from your other dependencies. If a package you depend on requires asana/asana, Composer resolves it to this fork rather than failing on the advisory:

Migrating an existing project: replace "asana/asana" with "tristan/asana" in your composer.json and run composer update. No source changes are required.

Test

After running composer install run the tests using:

You can also run the phpcs linter:

Authentication

Personal Access Token

Create a client using a personal access token:

OAuth 2

Asana supports OAuth 2. asana handles some of the details of the OAuth flow for you.

Create a client using your OAuth Client ID and secret:

Redirect the user to the authorization URL obtained from the client's session object:

authorizationUrl takes an optional state parameter, passed by reference, which will be set to a random number if null, or passed through if not null:

Or:

When the user is redirected back to your callback, check the state URL parameter matches, then pass the code parameter to obtain a bearer token:

For webservers, it is common practice to store the state in a secure-only, http-only cookie so that it will automatically be sent by the browser in the callback.

Note: if you're writing a non-browser-based application (e.x. a command line tool) you can use the special redirect URI urn:ietf:wg:oauth:2.0:oob to prompt the user to copy and paste the code into the application.

Usage

The client's methods are divided into several resources: attachments, events, projects, stories, tags, tasks, teams, users, and workspaces.

Methods that return a single object return that object directly:

Methods that return multiple items (e.x. getTasks, getProjects, getPortfolios, etc.) return an items iterator by default. See the "Collections" section

Options

Various options can be set globally on the Client.DEFAULTS object, per-client on client.options, or per-request as additional named arguments. For example:

Available options

Collections (methods returning an array as it's 'data' property):

Events:

Asana Change Warnings

You will receive warning logs if performing requests that may be affected by a deprecation. The warning contains a link that explains the deprecation.

If you receive one of these warnings, you should:

Read about the deprecation. Resolve sections of your code that would be affected by the deprecation. Add the deprecation flag to your "asana-enable" header. You can place it on the client for all requests, or place it on a single request.

$client = Asana\Client::accessToken('ASANA_PERSONAL_ACCESS_TOKEN', 
    array('headers' => array('asana-disable' => 'string_ids')))

or

$client = Asana\Client::accessToken('ASANA_PERSONAL_ACCESS_TOKEN', 
    array('headers' => array('asana-enable' => 'string_ids,new_sections')))

If you would rather suppress these warnings, you can set

$client = Asana\Client::accessToken('ASANA_PERSONAL_ACCESS_TOKEN', 
    array('log_asana_change_warnings' => false))

Collections

Items Iterator

By default, methods that return a collection of objects return an item iterator:

Internally the iterator may make multiple HTTP requests, with the number of requested results per page being controlled by the page_size option.

Raw API

You can also use the raw API to fetch a page at a time:

Contributing

Feel free to fork and submit pull requests for the code! Please follow the existing code as an example of style and make sure that all your code passes lint and tests.

To develop:

Code generation

The specific Asana resource classes in the Gen folder (Tag, Workspace, Task, etc) are generated code, hence they shouldn't be modified by hand.

Deployment

Repo Owners Only. Take the following steps to issue a new release of the library.

  1. Merge in the desired changes into the master branch and commit them.
  2. Clone the repo, work on master.
  3. Bump the package version in the VERSION file to indicate the semantic version change.
  4. Commit the change.
  5. Tag the commit with v plus the same version number you set in the file. git tag v1.2.3
  6. Push changes to origin, including tags: git push origin master --tags
  7. Log into packagist.org and click on the update button

The rest is automatically done by Composer / Packagist. Visit the tristan/asana package to verify the package was published.

NOTE: If the package did not update on Packagist, log into Packagist and click on the update button to manually update the package


All versions of asana with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-curl Version *
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
php-http/discovery Version ^1.19
php-http/multipart-stream-builder Version ^1.4
nyholm/psr7 Version ^1.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tristan/asana contains the following files

Loading the files please wait ...