Net::OpenXchange::Connection - Connection to OpenXchange server
version 0.001
Net::OpenXchange::Connection handles all the details of sending HTTP API requests to OpenXchange and decoding answers.
Required constructor argument. URI to the HTTP API of your OpenXchange server. Please note you have to add the /ajax manually.
Required constructor argument. Username to log into OpenXchange.
Required constructor argument. Password to log into OpenXchange.
Read-only. Instance of LWP::UserAgent which is used to send the requests.
Read-only. OpenXchange session ID.
my $uri = $conn->req_uri($path, %params); $conn->req_uri('folder', action => 'root'); "https://ox.example.com/folder?action=root&session=abcdef&timezone=UTC"
Construct a URI for an API request. $path is appended to the base URI and %params is converted into query parameters. Common query parameters are added as well.
my $resdata = $conn->send($req);
Send the request and decodes the JSON response body. If there is an error, it throws Net::OpenXchange::X::HTTP for HTTP errors and Net::OpenXchange::X::OX for errors indicated by OX in the response body.
$req should be a HTTP::Request object which can be created by using the helper functions in HTTP::Request::Common.
use HTTP::Request::Common; my $req = GET($conn->req_uri('login', action => 'logout')); $conn->send($req);
Maximilian Gass <maximilian.gass@credativ.de>
This software is copyright (c) 2011 by Maximilian Gass.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Net::OpenXchange, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::OpenXchange
CPAN shell
perl -MCPAN -e shell install Net::OpenXchange
For more information on module installation, please visit the detailed CPAN module installation guide.