NAME
WebService::30Boxes::API::Todo - Object returned by WebService::30Boxes::API::call("todo.Get")
SYNOPSIS
#$api_key and $auth_token are defined before
my $boxes = WebService::30Boxes::API->new(api_key => $api_key);
my $todos = $boxes->call('todos.Get', {authorizedUserToken => $auth_token});
if($todos->{'success'}){
#while ($todos->nextTodoId){ - if you use this, you don't need to specify
#$_ as an argument
#foreach (@{$todos->get_ref_todoIds}){
foreach ($todos->get_todoIds){
print "Todo id: $_\n";
print "Title: " . $todos->get_title($_) . "\n";
print "Tags: ";
foreach ($todos->get_tags($_)){print "$_\n";}
print "Done: " . $todos->isDone($_) . "\n";
print "Position: " . $todos->get_position($_) . "\n";
print "External UID: " . $todos->get_externalUID($_) . "\n";
}
}
else{
print "An error occured (" . $todos->{'error_code'} . ": " .
$todos->{'error_msg'} . ")\n";
}
DESCRIPTION
An object of this type is returned by the WebService::30Boxes::API::call("todos.Get") function
METHODS
The following methods can be used
new
Create a new WebService::30Boxes::API::Todo
object.
- result
-
(Mandatory) Result must be the the hash function returned by the XML parser. Results are undefined if some other hash is passed in.
- success
-
(Mandatory) If the API call was successful or not.
- error_code
-
(Optional) If success is false, this must be supplied
- error_message
-
(Optional) If success is false, this must be supplied
get_todoIds
Returns an array of todo ids.
You can then use this to call any of the following functions.
get_ref_todoIds
Returns a reference to an array of todo ids.
You can then use this to call any of the following functions.
nextTodoId
Advances the todo index and returns the new todoID (for convenience)
Arguments:
- todoId
-
(Optional) The todoId of the todo for which you want to retreive the information. If not present, the next todoId will be used as an index. The next todoId is set by calling nextTodoId.
get_tags
Returns a list of tags.
Arguments:
- todoId
-
(Optional) The todoId of the todo for which you want to retreive the information. If not present, the next todoId will be used as an index. The next todoId is set by calling nextTodoId.
get_title
Returns the title for the todo.
Arguments:
- todoId
-
(Optional) The todoId of the todo for which you want to retreive the information. If not present, the next todoId will be used as an index. The next todoId is set by calling nextTodoId.
isDone
Returns the todo is done or not Returns 1 if yes, 0 if not
Arguments:
- todoId
-
(Optional) The todoId of the todo for which you want to retreive the information. If not present, the next todoId will be used as an index. The next todoId is set by calling nextTodoId.
get_position
Returns the position of the todo as the user defined it
Arguments:
- todoId
-
(Optional) The todoId of the todo for which you want to retreive the information. If not present, the next todoId will be used as an index. The next todoId is set by calling nextTodoId.
get_externalUID
Returns the user defined ID for this todo The return value is a string
Arguments:
- todoId
-
(Optional) The todoId of the todo for which you want to retreive the information. If not present, the next todoId will be used as an index. The next todoId is set by calling nextTodoId.
TODO
Add more error checking. Compact the code and make it more efficient. Please email me for feature requests.
BUGS
Please notify chitoiup@umich.edu of any bugs.
SEE ALSO
http://30boxes.com/, http://30boxes.com/api/
WebService::30Boxes::API::Event
AUTHOR
Robert Chitoiu, <chitoiup@umich.edu>
COPYRIGHT AND LICENSE
Copyright (C) 2007 by Robert Chitoiu
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.