0

Here is the code I'm currently using to fetch data from Asana API: I have tried this code so please tell me where I'm wrong.

$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);
Matt
  • 5,478
  • 9
  • 56
  • 95
mohd afeef
  • 35
  • 1
  • 10
  • 2
    Could you clearify your problem? – Philip G Feb 18 '14 at 09:31
  • whats happened that you found you are wrong? – Alireza Feb 18 '14 at 09:42
  • i could not fetch tasks from api data though http header showing 200 ok – mohd afeef Feb 18 '14 at 09:43
  • This code is very difficult to read, I think the formatting might be off? Generally speaking, 200 means OK - which I'm surprised by, since you need to specify a workspace **and** an assignee. Even if this request went through, you should get a `400 Bad Request` with the response body `{"errors":[{"message":"assignee: Missing input"}]}`. – agnoster Feb 19 '14 at 21:47

0 Answers0