NAME

WebService::Kramerius::API4::User - Class to user endpoint in Kramerius v4+ API.

SYNOPSIS

use WebService::Kramerius::API4::User;

my $obj = WebService::Kramerius::API4::User->new(%params);
my $profile = $obj->profile;
my $user = $obj->user;

METHODS

new

my $obj = WebService::Kramerius::API4::User->new(%params);

Constructor.

  • library_url

    Library URL.

    This parameter is required.

    Default value is undef.

  • output_dispatch

    Output dispatch hash structure. Key is content-type and value is subroutine, which converts content to what do you want.

    Default value is blank hash array.

Returns instance of object.

profile

my $profile = $obj->profile;

Get user profile from Kramerius system.

Returns string with JSON.

user

my $user = $obj->user;

Get user from Kramerius system.

Returns string with JSON.

ERRORS

new():
        Parameter 'library_url' is required.
        From Class::Utils::set_params():
                Unknown parameter '%s'.

EXAMPLE1

use strict;
use warnings;

use WebService::Kramerius::API4::User;

if (@ARGV < 1) {
        print STDERR "Usage: $0 library_url\n";
        exit 1;
}
my $library_url = $ARGV[0];

my $obj = WebService::Kramerius::API4::User->new(
        'library_url' => $library_url,
);

my $profile_json = $obj->profile;

print $profile_json."\n";

# Output for 'http://kramerius.mzk.cz/', pretty print.
# {}

EXAMPLE2

use strict;
use warnings;

use WebService::Kramerius::API4::User;

if (@ARGV < 1) {
        print STDERR "Usage: $0 library_url\n";
        exit 1;
}
my $library_url = $ARGV[0];

my $obj = WebService::Kramerius::API4::User->new(
        'library_url' => $library_url,
);

my $user_json = $obj->user;

print $user_json."\n";

# Output for 'http://kramerius.mzk.cz/', pretty print.
# {
#   "lname": "not_logged",
#   "firstname": "not_logged",
#   "surname": "not_logged",
#   "session": {},
#   "roles": [
#     {
#       "name": "common_users",
#       "id": 1
#     }
#   ],
#   "id": -1,
#   "labels": []
# }

DEPENDENCIES

WebService::Kramerius::API4::Base.

REPOSITORY

https://github.com/michal-josef-spacek/WebService-Kramerius-API4

AUTHOR

Michal Josef Špaček mailto:skim@cpan.org

http://skim.cz

LICENSE AND COPYRIGHT

© Michal Josef Špaček 2015-2023

BSD 2-Clause License

VERSION

0.02