The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WebService::iThenticate::Response - manipulate response objects for the WebService::iThenticate

SYNOPSIS

 # 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

DESCRIPTION

This class encapsulates responses received from the WebService::iThenticate

METHODS

errors()
 %errors = %{ $response->errors };

Returns a hash reference of error name => error value, or undefined if no errors present.

sid()
 $sid = $response->sid;

Returns the session id for an authenticated client, or undefined if the client has not authenticated (no session present).

as_xml()
 $xml_response = $response->as_xml;

Returns the stringified xml response

timestamp()
 $timestamp = $response->timestamp;

Returns the timestamp of the api response in the format iso8601 XMLRPC field in UTC (with a "Z" appended).

api_status()
 $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()
 $id = $response->id;

Returns the id of a newly created object

report()
 $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()
 $document = $response->document;

Returns an hash reference of the document data

account()
 $account = $response->account;

Returns a hash reference of the account status

folder()
 $folder = $response->folder;

Returns a hash reference of the folder data

uploaded()
 $uploaded = $response->uploaded;

Returns an array reference of document hash references

documents()
 $documents = $response->documents;

Returns an array reference of document hash references

groups()
 @groups = @{ $response->groups };

Returns an array reference of group hash references

folders()
 $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()
 @users = @{ $response->users };

Returns an array reference of user hash references

messages()
 if ( $response->messages ) {
     @messages = @{ $response->messages };
 }

Returns an array reference of message scalars

SEE ALSO

WebService::iThenticate::Request, WebService::iThenticate::Client, RPC::XML

AUTHOR

Fred Moyer <fred@turnitin.com>

COPYRIGHT

Copyright (C) (2011) iParadigms, LLC. All rights reserved.

LICENSE

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.