title: How to grab tasks from Google Tasks API for Google Apps Domains?
body: <p>I made the following code that works with the Google Tasks API but it only shows result when its from gmail.com. Any custom Google Apps domain it doesn't work for. Does anyone know the url I should use for the Google Apps Domain Tasks API?</p>
  
  <p>Code:</p>
  
  <pre><code>&lt;?php
  session_start();
  
  //load libs
  require_once "include/google-api-php-client/src/apiClient.php";
  require_once "include/google-api-php-client/src/contrib/apiTasksService.php";
  
  //load api
  $apiClient = new apiClient();
  $service = new apiTasksService($apiClient);
  
  //authenticate
  if (isset($_SESSION['oauth_access_token'])) {
    $apiClient-&gt;setAccessToken($_SESSION['oauth_access_token']);
  } else {
    $token = $apiClient-&gt;authenticate();
    $_SESSION['oauth_access_token'] = $token;
  }
  
  //get token
  //echo "token: ".$_SESSION['oauth_access_token']."&lt;br /&gt;";
  
  //get list
  $taskLists = $service-&gt;listTasklists();
  
  foreach ($taskLists['items'] as $taskList) {
    echo $taskList['title'] . " - " . $taskList['id'] . "&lt;br /&gt;";
  }
  
  
  //get list items
  echo "&lt;ul&gt;";
  $tasks = $service-&gt;listTasks('@default');
  
  foreach($tasks['items'] as $task) {
      $title = $task['title'];
      echo "&lt;li&gt;$title&lt;/li&gt;";
  }
  echo "&lt;/ul&gt;&amp;#9644;&amp;#9644;&amp;#9644;";
  
  
  
  ?&gt;
  </code></pre>