WebService::iThenticate::Response - manipulate response objects for the WebService::iThenticate
# make the request $response = $ithenticate_api_client->login; # check for any errors my %errors = %{ $response->errors }; foreach my $key ( keys %errors ) { warn(sprintf('Error %s encountered, message %s', $key, $errors{$key})); } # grab the numeric api status code $api_status_code = $response->api_status; # grab the session id $sid = $response->sid
This class encapsulates responses received from the WebService::iThenticate
%errors = %{ $response->errors };
Returns a hash reference of error name => error value, or undefined if no errors present.
$sid = $response->sid;
Returns the session id for an authenticated client, or undefined if the client has not authenticated (no session present).
$xml_response = $response->as_xml;
Returns the stringified xml response
$timestamp = $response->timestamp;
Returns the timestamp of the api response in the format iso8601 XMLRPC field in UTC (with a "Z" appended).
$api_status = $response->api_status;
Returns the numeric api status code for the client request.
Values correspond to HTTP status codes, e.g. 200 OK, 404 Not Found, etc.
$id = $response->id;
Returns the id of a newly created object
$report = $response->report; # a url to view the report which requires user authentication $report_url = $report->{report_url}; # a view only report url which expires in a set amount of time $view_only_url = $report->{view_only_url}; # the expiration time in minutes of the $view_only_url $view_only_expires = $report->{view_only_expires};
Returns a hash reference containing links to view the report, one link requires authentication, one does not but expires a set amount of time after the api request is made.
$document = $response->document;
Returns an hash reference of the document data
$account = $response->account;
Returns a hash reference of the account status
$folder = $response->folder;
Returns a hash reference of the folder data
$uploaded = $response->uploaded;
Returns an array reference of document hash references
$documents = $response->documents;
@groups = @{ $response->groups };
Returns an array reference of group hash references
$folders_array_reference = $response->folders;
where the array reference contains a set of hash references with the folder data
[ { folder_id => '1', name => 'test_folder', }, { ... }, ]
Returns an array reference of folder hash references
@users = @{ $response->users };
Returns an array reference of user hash references
if ( $response->messages ) { @messages = @{ $response->messages }; }
Returns an array reference of message scalars
WebService::iThenticate::Request, WebService::iThenticate::Client, RPC::XML
Fred Moyer <fred@turnitin.com>
Copyright (C) (2011) iParadigms, LLC. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install WebService::iThenticate::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::iThenticate::Client
CPAN shell
perl -MCPAN -e shell install WebService::iThenticate::Client
For more information on module installation, please visit the detailed CPAN module installation guide.