cx-reports/api-client
最新稳定版本:0.0.1
Composer 安装命令:
composer require cx-reports/api-client
包简介
A client for interacting and downloading reports from the CxReports
README 文档
README
Overview
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.
Features
- Authentication with API tokens
- Preview reports by ID
- Download reports as PDF
- Fetch workspaces
- Retrieve report types
Installation
You can install the library via Composer:
composer require cx-reports/api-client
Usage
Initializing the Client
require 'vendor/autoload.php'; use CxReports\Client\CxReportsClient; $url = ""; $workspace_id = 0; $pat = ""; $client = new CxReportsClient($url, $workspace_id, $pat);
Downloading a Report as PDF
$response = $client->downloadPdf("149", [], 26); $response = $client->downloadPdf("149", [], 26);
Fetching Workspaces
$workspaces = $client->getWorkspaces();
Fetching Report Types
$reportTypes = $client->getReportTypes();
Error Handling
The library provides built-in error handling:
try { $report = $client->getReport("invalid-id"); } catch (Exception $e) { echo "Error: " . $e->getMessage(); }
License
This library is licensed under the MIT License.
Contributing
Contributions are welcome! Please submit a pull request or open an issue on GitHub.
Support
For any issues or questions, contact support@cx-reports.com.
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-24