NAME

Hetula::Client

DESCRIPTION

Perl client implementation to communicate with Hetula, the Patron data store

SYNOPSIS

my $hc = Hetula::Client->new({baseURL => 'https://hetula.example.com'});

my $loginResponse = $hc->login({username => 'master', password => 'blaster', organization => 'Administratoria'});
die($loginResponse->{error}) if ($loginResponse->{error});

my $loginActiveResp = $hc->loginActive();
ok(! $loginActiveResp->{error}, "Login active");

my $ssnAddResp = $hc->ssnAdd({ssn => 'bad-ssn'});
ok($ssnAddResp->{error}, "SSN add failed - Bad SSN '$ssnAddResp->{error}'");

my $ssnGetResp = $hc->ssnGet({id => 1});
ok(! $ssnGetResp->{error}, "SSN got");

my $ssnsBatchAddResp = $hc->ssnsBatchAdd(['101010-101A', '101010-102B']);
is(@$ssnsBatchAddResp, 2, "SSNs batch add");

new

@param1 {HASHRef} baseURL => https://hetula.example.com

API Access methods

login

See Hetula API doc for endpoint POST /api/v1/auth

loginActive

ssnAdd

See Hetula API doc for endpoint POST /api/v1/ssns

ssnGet

See Hetula API doc for endpoint GET /api/v1/users/<id>

@param1 {HASHRef} id => ssn id to get

ssnsBatchAdd

See Hetula API doc for endpoint GET /api/v1/ssns/batch

@param1 {ARRAYRef} of ssns

userAdd

See Hetula API doc for endpoint POST /api/v1/users

userBasicAdd

Adds a user with only the most minimum permisions needed to push records into Hetula. Organization the user belongs to is implied from the currently logged in organization.

@param {HASHRef} username => 'MattiM',
                 password => 'Secret',
                 realname => 'Matti Meikäläinen',

userReadAdd

Adds a user with read access to Hetula. Organization the user belongs to is implied from the currently logged in organization.

@param {HASHRef} username => 'MattiM',
                 password => 'Secret',
                 realname => 'Matti Meikäläinen',

userMod

See Hetula API doc for endpoint PUT /api/v1/users/<id>

@param {HASHRef} username or id => mandatory,
                 other patron attributes => and values,
                 ...

userChangePassword

@param {HASHRef} username or id => mandatory,
                 password => mandatory - the new password,

userDisableAccount

To recover from a disabled account, change the password

@param {String} username or id

ATTRIBUTES

ua

baseURL

1 POD Error

The following errors were encountered while parsing the POD:

Around line 158:

Non-ASCII character seen before =encoding in 'Meikäläinen','. Assuming UTF-8