WebService::ILS::OverDrive::Patron - WebService::ILS module for OverDrive circulation services
use WebService::ILS::OverDrive::Patron;
These services require individual user credentials. See "WebService::ILS INDIVIDUAL USER AUTHENTICATION AND METHODS"
See WebService::ILS::OverDrive
auth_token
website_id and authorization_name (domain) are provided by OverDrive
website_id
authorization_name
With OverDrive there's an extra step - an auth code is returned to the redirect back handler that needs to make an API call to convert it into a auth token.
An example:
my $overdrive = WebService::ILS::OverDrive::Patron({ client_id => $client_id, client_secret => $client_secret, library_id => $library_id, }); my $redirect_url = $overdrive->auth_url("http://myapp.com/overdrive-auth"); $response->redirect($redirect_url); ... /overdrive-auth handler: my $auth_code = $req->param( $overdrive->auth_code_param_name ) or some_error_handling(), return; # my $state = $req->param( $overdrive->state_token_param_name )... local $@; eval { $overdrive->auth_by_code( $auth_code ) }; if ($@) { some_error_handling(); return; } $session{overdrive_access_token} = $access_token; $session{overdrive_access_token_type} = $access_token_type; $session{overdrive_auth_token} = $auth_token; ... Somewhere else in your app: my $ils = WebService::ILS::Provider({ client_id => $client_id, client_secret => $client_secret, access_token => $session{overdrive_access_token}, access_token_type => $session{overdrive_access_token_type}, auth_token = $session{overdrive_auth_token} }); my $checkouts = $overdrive->checkouts;
redirect_uri
state_token
for additional security; not required
Differences to general WebService::ILS interface
$notification_email_address and $auto_checkout are optional. $auto_checkout defaults to false.
$notification_email_address
$auto_checkout
It is prefered that the $notification_email_address is specified.
If $auto_checkout is set to true, the item will be checked out as soon as it becomes available.
For formats see checkout_formats() below
checkout_formats()
$format and $allow_multiple_format_checkouts are optional. $allow_multiple_format_checkouts defaults to false.
$format
$allow_multiple_format_checkouts
An item can be available in multiple formats. Checkout is complete only when the format is specified.
Checkout can be actioned without format being specified. In that case an early return can be actioned. To complete checkout format must be locked later (see lock_format() below). That would be the case with place_hold() with $auto_checkout set to true. Once format is locked, an early return is not possible.
If $allow_multiple_format_checkouts flag is set to true, mutiple formats of the same item can be acioned. If it is false (default) and the item was already checked out, the checked out item record will be returned regardless of the format.
Checkout record will have an extra field format if format is locked in.
format
{ format => available, ... }
If format is not immediately available it must be locked first
Checked out items must be downloaded by users on the OverDrive site. This method returns the url where the user should be sent to (redirected). Once the download is complete, user will be redirected back to $error_url in case of an error, otherwise to optional $success_url if specified.
$error_url
$success_url
See https://developer.overdrive.com/apis/download
See https://developer.overdrive.com/apis/patron-information
See https://developer.overdrive.com/apis/holds
See https://developer.overdrive.com/apis/checkouts
Copyright (C) Catalyst IT NZ Ltd Copyright (C) Bywater Solutions
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Srdjan Janković <srdjan@catalyst.net.nz>
To install WebService::ILS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::ILS
CPAN shell
perl -MCPAN -e shell install WebService::ILS
For more information on module installation, please visit the detailed CPAN module installation guide.