WebService::ShiftPlanning - Minimal ShiftPlanning API call support for Perl
use WebService::ShiftPlanning; my $caller = WebService::ShiftPlanning->new; $caller->doLogin('username', 'password'); use Data::Dumper; print ::Dumper($caller->doCall('GET', 'dashboard.onnow'));
A basic API wrapper for ShiftPlanning, supporting authentication, making calls, and throwing exceptions on error.
Create a new WebService::ShiftPlanning object.
Takes the http endpoint and api key as optional hash parameters.
my $agent = WebService::ShiftPlanning->new(); my $agent = WebService::ShiftPlanning->new( endpoint => 'https://www.shiftplanning.com/api/', key => '234243iyu23i4y23409872309470923740987234', );
Log in to shiftplanning.com
Make a ShiftPlanning API call. Usage:
doCall(method, module, param => value);
eg:
doCall('GET', 'dashboard.onnow');
Dies on HTTP error or on ShiftPlanning.com API error (non-1 status). Otherwise returns Perl hash/array decoded from the JSON response from the server.
For the details of usage, you'll need to use the ShiftPlanning API docs.
To install WebService::ShiftPlanning, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::ShiftPlanning
CPAN shell
perl -MCPAN -e shell install WebService::ShiftPlanning
For more information on module installation, please visit the detailed CPAN module installation guide.