The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WebService::30Boxes::API - Perl interface to the 30 Boxes API

SYNOPSIS

  use WebService::30Boxes::API;

  #$api_key and $auth_token are defined before
  my $boxes = WebService::30Boxes::API->new(api_key => $api_key);

  my $events = $boxes->call('events.Get', {authorizedUserToken => $auth_token});
  #my $todos = $boxes->call('todos.Get', {authorizedUserToken => $auth_token});
  if($events->{'success'}){
        print "List start: " . $events->get_listStart . "\n";
        print "List end: " . $events->get_listEnd . "\n";
        print "User Id: " . $events->get_userId . "\n\n\n";
  
        #while ($events->nextEventId){ - if you use this, you don't need to specify
        #$_ as an argument
        #foreach (@{$events->get_ref_eventIds}){
        foreach ($events->get_eventIds){
                print "Event id: $_\n";
                print "Title: " . $events->get_title($_) . "\n";
                print "Repeat end date: " . $events->get_repeatEndDate($_) . "\n";
                print "Repeat skip dates: ";
                foreach ($events->get_repeatSkipDates($_)){print "$_\n";}
                print "Repeat type: " . $events->get_repeatType($_) . "\n";
                print "Repeat interval: " . $events->get_repeatInterval($_) . "\n";
                print "Reminder: " . $events->get_reminder($_) . "\n";
                print "Tags: ";
                foreach ($events->get_tags($_)){print "$_\n";}
                print "Start date: " . $events->get_startDate($_) . "\n";
                print "Start time: " . $events->get_startTime($_) . "\n";
                print "End date: " . $events->get_endDate($_) . "\n";
                print "End time: " . $events->get_endTime($_) . "\n";
                print "Is all day event: " . $events->get_isAllDayEvent($_) . "\n";
                print "Notes: ";
                foreach ($events->get_notes($_)){print "$_\n";}
                print "Privacy: " . $events->get_privacy($_) . "\n\n";
        }
  }
  else{
        print "An error occured (" . $events->{'error_code'} . ": " .
                $events->{'error_msg'} . ")\n";
  }

DESCRIPTION

WebService::30Boxes::API - Perl interface to the 30 Boxes API

METHODS

The following methods can be used

new

new create a new WebService::30Boxes::API object

options

api_key

The API key is required and this module will croak if you do not set one here. A fresh key can be obtained at http://30boxes.com/api/api.php?method=getKeyForUser

call

With this method, you can call one of the available methods as described on http://30boxes.com/api/.

call accepts a method name followed by a hashref with the values to pass on to 30Boxes. object.

It returns an object of type WebService::30Boxes::API::Event or WebService::30Boxes::API::Todo (depending which API method was called), which the user can then use to get the desired information.

request_auth_url

Some API methods require authentication (permission by the user). This is done by sending the user to a specific URL where permission can be granted or denied. This method accepts a hashref with these three values:

applicationName

(Mandatory) applicationName sets the well, application name you want to show to the user.

applicationLogoUrl

(Mandatory) The URI to your logo.

returnUrl

(Optional) This is where you want the user to return too after permission is granted.

SEE ALSO

http://30boxes.com/, http://30boxes.com/api/

WebService::30Boxes::API::Response

WebService::30Boxes::API::Event

WebService::30Boxes::API::Todo

30boxes.pl - this is a Perl script you can find on CPAN under Web that can be run in the terminal and it will display the events for a given period of time along with the Todo list. It takes command line arguments that specify how many days/weeks worth of events and how many todos will be displayed. I use it to display events and todos when I open my terminal. Send me an email with bugs or feature requests.

TODO

Add more error checking. Compact the code and make it more efficient. Please email me for feature requests.

BUGS

Please email chitoiup@umich.edu with any bugs.

AUTHORS

M. Blom (main functionality), <blom@cpan.org>, http://menno.b10m.net/perl/

Robert Chitoiu (integration with Event and Todo) <chitoiup@umich.edu>

COPYRIGHT

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.