1. Go to this page and download the library: Download ajimix/asana-api-php-class library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ajimix / asana-api-php-class example snippets
$asana = new Asana([
'personalAccessToken' => 'GET_IT_FROM_ASANA'
]);
$asana->createTask([
'workspace' => '176825', // Workspace ID
'name' => 'Hello World!', // Name of task
'assignee' => '[email protected]', // Assign task to...
'followers' => ['3714136', '5900783'] // We add some followers to the task... (this time by ID)
]);
$asana->commentOnTask('MY_BEAUTIFUL_TASK_ID', 'Please please! Don\'t assign me this task!');
$asana->getProjects();
$asana->updateProject('COOL_PROJECT_ID', [
'name' => 'This is a new cool project!',
'notes' => 'At first, it wasn\'t cool, but after this name change, it is!'
]);
$asana->getData();
$asanaAuth = new AsanaAuth('YOUR_APP_ID', 'YOUR_APP_SECRET', 'CALLBACK_URL');
$url = $asanaAuth->getAuthorizeUrl();