Skip to content

Instantly share code, notes, and snippets.

@128keaton
Last active August 26, 2015 19:18
Show Gist options
  • Save 128keaton/cec77b3339d2719221de to your computer and use it in GitHub Desktop.
Save 128keaton/cec77b3339d2719221de to your computer and use it in GitHub Desktop.
Hello Polly,
Let me explain the issues ive been having with the API.
Here is my HTML code for fetching the list id for the name 'Today':
$tomorrow_id;
$today_id;
$ch2 = curl_init();
curl_setopt($ch2, CURLOPT_URL, "https://a.wunderlist.com/api/v1/lists");
//return the transfer as a string
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch2, CURLOPT_HTTPHEADER, array(
'X-Access-Token: 346bcca426d064414b530eaab710db7e462e8a002975bcd0e0d94ffabb58',
'X-Client-ID: ed14a2c61edd76501b1f'
));
// $output contains the output string
$output2 = curl_exec($ch2);
$json = json_decode($output2, true);
// close curl resource to free up system resources
curl_close($ch2);
foreach ($json as $key => $val) {
if ($val['title'] == "Today"){
// echo ("Today! \n");
$today_id = $val['id'];
}else if ($val['title'] == "Tomorrow"){
// echo ("Tomorrow! \n");
$tomorrow_id = $val['id'];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment