dennisoderwald / laravel-asana

Asana API wrapper for Laravel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Asana for Laravel

Latest Stable Version Total Downloads


Installation

To get the latest version of Laravel Asana simply require it in your composer.json file.

"torann/laravel-asana": "0.1.*@dev"

You'll then need to run composer install to download it and have the autoloader updated.

Create configuration file using artisan

$ php artisan config:publish torann/laravel-asana

Now add Asana in your providers array app/config/app.php

'Torann\LaravelAsana\ServiceProvider'

Quick Examples

Get a specific user

Asana::getUserInfo($user_id);

Get current user

Will return the user's info of the owner of the API key.

Asana::getCurrentUser();

Get all users in all workspaces

Will return the user's info of the owner of the API key.

Asana::getUsers();

Get task

Asana::getTask($task_id);

Get a task's sub-tasks

Asana::getSubTasks($task_id);

Creating a task

Asana::createTask(array(
   'workspace' => '176825', // Workspace ID
   'name'      => 'Hello World!', // Name of task
   'assignee'  => 'foo@bar.com', // Assign task to...
   'followers' => array('3714136', '5900783') // We add some followers to the task... (this time by ID)
));

Adding task to project

Asana::addProjectToTask($task_id, $project_id);

Remove task from a project

Asana::removeProjectToTask($task_id, $project_id);

Get task stories

Asana::getTaskStories($task_id);

Commenting on a task

Asana::commentOnTask($task_id, "Please please! Don't assign me this task!");

Add a tag to a task

Asana::addTagToTask($task_id, $tag_id);

Remove a tag from a task

Asana::removeTagFromTask($task_id, $tag_id);

Create a project

Asana::createProject(array(
    "workspace" => "1768",
    "name"      => "Foo Project!",
    "notes"     => "This is a test project"
));

Getting projects in all workspaces

Asana::getProjects();

Get projects in a workspace

$archived = false;

Asana::getProjectsInWorkspace($workspace_id, $archived);

Updating project info

Asana::updateProject($project_id, array(
    'name' => 'This is a new cool project!',
    'notes' => 'At first, it wasn't cool, but after this name change, it is!'
));

Get project tasks

Asana::getProjectTasks($project_id);

Get project stories

Asana::getProjectStories($project_id);

Get a specific story

Asana::getSingleStory($story_id);

Comment on a project

$text = "Such fun!";

Asana::commentOnProject($project_id, $text)

Get a specific tag

Asana::getTag($tag_id);

Get tags

Asana::getTags();

Update tag

// $data - array - An array containing fields to update, see Asana API if needed.

Asana::updateTag($tag_id, $data);

Get tasks with tag

Asana::getTasksWithTag($tag_id);

Get workspaces

Asana::getWorkspaces();

Update workspace

$data = array('name' => '');

Asana::updateWorkspace($workspace_i, $data);

Get workspace tasks

// Assignee can either be 'me' or a user's ID

Asana::getWorkspaceTasks($workspace_id, $assignee);

Get workspace tags

Asana::getWorkspaceTags($workspace_id);

Get workspace users

Asana::getWorkspaceUsers($workspace_id);

Filtering

If you specify an assignee, you must also specify a workspace to filter on.

Asana::getTasksByFilter(array(
    'assignee'  => 1121,
    'project'   => 37373729,
    'workspace' => 111221
));

About

Asana API wrapper for Laravel

License:BSD 2-Clause "Simplified" License


Languages

Language:PHP 100.0%