如何通过Asana API获取任务

时间:2014-02-18 09:06:20

标签: php curl asana

以下是我目前用于从Asana API获取数据的代码:我已经尝试过这段代码,所以请告诉我我哪里错了。

$tasks = $client->fetch('https://app.asana.com/api/1.0/workspaces.json');

//print_r($tasks);

//as i do print_r then i get whole workspace data 
$i=0;

//then i intialize counter with a value zero.
while(isset($tasks['result']['data'][$i]['id']))
{ 

    //then go through loop to fetch data from array.
    //print_r($tasks);

    //then i cross check that array

    $user_detail = $client->fetch('https://app.asana.com/api/1.0/workspaces/'.$tasks['result']['data'][$i]['id'].'/tasks.json');

    //then i fetch tasks through url , in http header  response is 200 ok ,  and  i also cross check my account tasks also so where im wrong.  

    print_r($user_detail);

0 个答案:

没有答案