-
Notifications
You must be signed in to change notification settings - Fork 12
Methods: Projects
Fabian Beiner edited this page Nov 15, 2017
·
5 revisions
Method:
getAllProjects();
Example:
$allProjects = $Todoist->getAllProjects();
print_r($allProjects);
Array
(
[0] => stdClass Object
(
[id] => 2168427835
[name] => Inbox
[order] => 0
[indent] => 1
[comment_count] => 0
)
[1] => stdClass Object
(
[id] => 2168427836
[name] => Personal
[order] => 1
[indent] => 1
[comment_count] => 0
)
[2] => stdClass Object
(
[id] => 2168427838
[name] => Work
[order] => 2
[indent] => 1
[comment_count] => 0
)
[3] => stdClass Object
(
[id] => 2168427837
[name] => Shopping
[order] => 3
[indent] => 1
[comment_count] => 1
)
[4] => stdClass Object
(
[id] => 2168428146
[name] => Groceries
[order] => 4
[indent] => 2
[comment_count] => 0
)
[5] => stdClass Object
(
[id] => 2168428192
[name] => Clothes
[order] => 5
[indent] => 2
[comment_count] => 0
)
)
Method:
createProject($name);
Example:
$createProject = $Todoist->createProject('Example Project');
print_r($createProject);
stdClass Object
(
[id] => 2168428901
[name] => Example Project
[order] => 10
[indent] => 1
[comment_count] => 0
)
Method:
getProject($projectId);
Example:
$project = $Todoist->getProject('2168427837');
print_r($project);
stdClass Object
(
[id] => 2168427837
[name] => Shopping
[order] => 3
[indent] => 1
[comment_count] => 1
)
Method:
updateProject($projectId, $name); // also renameProject($projectId, $name);
Example:
$success = $Todoist->updateProject('2168428901', 'Example Project Renamed');
print_r($success);
1
Method:
deleteProject($projectId);
Example:
$success = $Todoist->deleteProject('2168428901')
print_r($success);
1
👋