Net::OpenXchange::Connection - Connection to OpenXchange server
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.
use HTTP::Request::Common; my $req = GET($conn->req_uri('login', action => 'logout')); $conn->send($req);
Maximilian Gass <firstname.lastname@example.org>
This software is copyright (c) 2011 by Maximilian Gass.