ncbp/psa-kiota-client
Composer 安装命令:
composer require ncbp/psa-kiota-client
包简介
ConnectWise PSA API client generated using Microsoft Kiota
README 文档
README
A PHP client library for ConnectWise PSA API generated using Microsoft Kiota.
Description
This library provides a strongly-typed PHP client for interacting with the ConnectWise PSA API. It is generated using Microsoft's Kiota tool, which creates client libraries from OpenAPI specifications.
Installation
Install the package via Composer:
composer require ncbp/psa-kiota-client
Requirements
- PHP 8.0 or higher
- Composer
Dependencies
- microsoft/kiota-abstractions: ^1.5
- microsoft/kiota-serialization-form: ^1.5
- microsoft/kiota-serialization-json: ^1.5
- microsoft/kiota-serialization-multipart: ^1.5
- microsoft/kiota-serialization-text: ^1.5
- symfony/http-client: ^7.3
Usage
Basic Usage
<?php
require_once 'vendor/autoload.php';
use Microsoft\Kiota\Abstractions\Authentication\AnonymousAuthenticationProvider;
use Microsoft\Kiota\Http\Middleware\Options\RedirectHandlerOption;
use Microsoft\Kiota\Http\Symfony\SymfonyRequestAdapter;
use NCBP\Psa\Api\Client\Kiota\ApiClient;
// Create an authentication provider
// Note: Replace with appropriate authentication for ConnectWise PSA
$authProvider = new AnonymousAuthenticationProvider();
// Create request adapter with authentication
$requestAdapter = new SymfonyRequestAdapter($authProvider);
// Configure middleware options if needed
$requestAdapter->setMiddlewareOptions([
RedirectHandlerOption::class => new RedirectHandlerOption(true, 5)
]);
// Create the API client
$client = new ApiClient($requestAdapter);
// Optional: Set a custom base URL if needed
// $requestAdapter->setBaseUrl('https://custom-connectwise-instance.com/v4_6_release/apis/3.0');
// Use the client to access different areas of the API
try {
// Example: Get company information
$companies = $client->company()->companies()->get();
// Process the response
foreach ($companies->getValue() as $company) {
echo "Company: " . $company->getName() . PHP_EOL;
}
} catch (Exception $e) {
echo "Error: " . $e->getMessage() . PHP_EOL;
}
Available API Areas
The client provides access to the following ConnectWise PSA API areas:
- Company:
$client->company() - Configurations:
$client->configurations() - Expense:
$client->expense() - Finance:
$client->finance() - Marketing:
$client->marketing() - Procurement:
$client->procurement() - Project:
$client->project() - Sales:
$client->sales() - Schedule:
$client->schedule() - Service:
$client->service() - System:
$client->system() - Time:
$client->time()
Each area provides specific endpoints for interacting with different aspects of the ConnectWise PSA system.
Authentication
Refer to the ConnectWise API documentation for specific authentication requirements and implement the appropriate authentication provider.
Regenerating the Client
If you need to regenerate the client from an updated OpenAPI specification:
- Ensure you have the Kiota CLI tool installed in the bin directory and that it is named
kiota - Run the provided Composer script:
composer generate-client
This will regenerate the client code based on the schema file located at schema/All.json.
This file must be acquired from https://developer.connectwise.com.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
- David Legatt (legattd@ncbpinc.com)
ncbp/psa-kiota-client 适用场景与选型建议
ncbp/psa-kiota-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 07 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 ncbp/psa-kiota-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ncbp/psa-kiota-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 18
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-30