The cx-reports/api-client
provides an easy-to-use interface for interacting with the CxReports API. This library allows developers to preview reports, download reports as PDFs, retrieve workspace information, and more.
- Authentication with API tokens
- Preview reports by ID
- Download reports as PDF
- Fetch workspaces
- Retrieve report types
You can install the library via Composer:
composer require cx-reports/api-client
require 'vendor/autoload.php';
use CxReports\Client\CxReportsClient;
$url = "";
$workspace_id = 0;
$pat = "";
$client = new CxReportsClient($url, $workspace_id, $pat);
$response = $client->downloadPdf("149", [], 26);
$response = $client->downloadPdf("149", [], 26);
$workspaces = $client->getWorkspaces();
$reportTypes = $client->getReportTypes();
The library provides built-in error handling:
try {
$report = $client->getReport("invalid-id");
} catch (Exception $e) {
echo "Error: " . $e->getMessage();
}
This library is licensed under the MIT License.
Contributions are welcome! Please submit a pull request or open an issue on GitHub.
For any issues or questions, contact support@cx-reports.com.