我制作了以下与Google Tasks API一起使用的代码,但它只显示来自gmail.com的结果。它不适用于任何自定义Google Apps域。有谁知道我应该用于Google Apps Domain Tasks API的网址?
代码:
<?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->setAccessToken($_SESSION['oauth_access_token']);
} else {
$token = $apiClient->authenticate();
$_SESSION['oauth_access_token'] = $token;
}
//get token
//echo "token: ".$_SESSION['oauth_access_token']."<br />";
//get list
$taskLists = $service->listTasklists();
foreach ($taskLists['items'] as $taskList) {
echo $taskList['title'] . " - " . $taskList['id'] . "<br />";
}
//get list items
echo "<ul>";
$tasks = $service->listTasks('@default');
foreach($tasks['items'] as $task) {
$title = $task['title'];
echo "<li>$title</li>";
}
echo "</ul>▬▬▬";
?>
答案 0 :(得分:1)
此处正在跟踪此特定问题:https://code.google.com/apis/tasks/forum.html?place=topic%2Fgoogle-tasks-api%2FCVyxwz-Z9Rg%2Fdiscussion
答案 1 :(得分:0)
我正在使用gafyd,它对我有用。您的域名是否已迁移到新系统?