Skip to content

Instantly share code, notes, and snippets.

@kirkouimet
kirkouimet / CopyAsanaTasks.php
Last active December 18, 2015 14:58 — forked from mhdhejazi/CopyAsanaTasks.php
Allows you to duplicate a project in Asana and put it in another workspace
<?php
function asanaRequest($methodPath, $httpMethod = 'GET', $body = null) {
$apiKey = 'ASANA_API_KEY_HERE'; /// Get it from http://app.asana.com/-/account_api
$url = "https://app.asana.com/api/1.0/$methodPath";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ) ;
curl_setopt($ch, CURLOPT_USERPWD, $apiKey);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);