Skip to content

Instantly share code, notes, and snippets.

@mannieschumpert
Last active January 3, 2016 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mannieschumpert/8480059 to your computer and use it in GitHub Desktop.
Save mannieschumpert/8480059 to your computer and use it in GitHub Desktop.
A PHP script to add a list of tasks to Asana via an array.
<?php
$apikey = ""; // Your API key
$workspace = ''; // your project's workspace ID
$project = ''; // your project's ID
$tasks = array(
'Task 1',
'Task 2',
'Task 3'
// etc
);
// use this line if you want your tasks to be displayed in Asana in the order of the array
$tasks = array_reverse($tasks);
foreach ($tasks as $task){
exec( 'curl -u '.$apikey.': https://app.asana.com/api/1.0/tasks -d "name='.$task.'" -d "projects[0]='.$project.'" -d "workspace='.$workspace.'"', $return);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment