silinternational / trello-php-client
此包已被废弃,不再维护。未建议替代包。
与 Trello API 交互的 PHP 客户端库
0.2.1
2020-05-12 17:06 UTC
Requires
- php: >=7.2.0
- guzzlehttp/guzzle-services: *
Requires (Dev)
- ext-json: *
- phpunit/phpunit: ~4.0
- roave/security-advisories: dev-master
This package is auto-updated.
Last update: 2021-01-23 17:14:53 UTC
README
trello-php-client
PHP 客户端用于与 Trello API 交互。
随着我们需要的功能逐渐构建此客户端。最初我们只需要它来添加组织中的账户。
此客户端基于 Guzzle,PHP HTTP 客户端。Guzzle 提供了一种简单的方式来创建 API 客户端,通过 Swagger-like 格式描述 API 而无需实现每个方法。因此,添加对更多 Trello API 的支持相对简单。如果您想提交 pull request 来添加新功能,请这样做。如果您不知道如何这样做,请向我们询问,我们可能可以帮助您添加。
Trello API 文档
Trello API 认证
Trello 使用密钥/令牌对进行 API 调用的认证。您可以在 https://trello.com/1/appKey/generate 获取密钥/密钥。
安装
使用 Composer 安装很简单。将 "silinternational/trello-php-client": "dev-master"
添加到您的 composer.json
文件中,然后更新。
用法
示例
<?php use Trello\Organization; $org = new Organization([ 'key' => '1234567890', 'token' => 'aasddfffds', ]); $user = $org->addMember([ 'idOrg' => '5519vgdgh561a4a4b51154123b', 'email' => 'testuser@domain.org', 'fullName' => 'Test User', ]); echo $user['id']; // 552bfa4aadda3e05254317k
Guzzle 服务客户端说明
- 使用 Guzzle Web Services 开发 API 客户端的教程:http://www.phillipshipley.com/2015/04/creating-a-php-nexmo-api-client-using-guzzle-web-service-client-part-1/
- Jeremy Lindblom 的演示:https://speakerdeck.com/jeremeamia/building-web-service-clients-with-guzzle-1
- Jeremy Lindblom 的示例:https://github.com/jeremeamia/sunshinephp-guzzle-examples
- 源代码注释中的参数文档:https://github.com/guzzle/guzzle-services/blob/master/src/Parameter.php