NAME

WebService::ShiftPlanning - Minimal ShiftPlanning API call support for Perl

SYNOPSIS

use WebService::ShiftPlanning;
my $caller = WebService::ShiftPlanning->new;
$caller->doLogin('username', 'password');
use Data::Dumper;
print ::Dumper($caller->doCall('GET', 'dashboard.onnow'));

DESCRIPTION

A basic API wrapper for ShiftPlanning, supporting authentication, making calls, and throwing exceptions on error.

METHODS

new

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',
);

doLogin

Log in to shiftplanning.com

doCall

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.