smart-contact/trustpilot-api-service
最新稳定版本:v1.2.1
Composer 安装命令:
composer require smart-contact/trustpilot-api-service
包简介
PHP API Service for Trustpilot
README 文档
README
PHP Service class for trustpilot APIs.
Installation
You can install the package via composer:
composer require smart-contact/trustpilot-api-service
Usage
To use this class you have to pass this information: business unit ID, API KEY, API Secret, your username and password.
All the available methods try to follow the same name as the API documentation. All 'GET' requests, accept a param as query params and use the same keys as documentation. All 'POST' requests, accept 2 params, data and options(optional), same as query params, all keys are equal to the documentation.
use SmartContact/TrustpilotApiService/TrustpilotApiService; $trustpilotService = new TrustpilotApiService(); $trustpilotService->init([ 'business_unit_id' => '123456789', 'api_key' => 'abcdefghijklmnopqrstuvwxyz', 'api_secret' => '123456789abcdefghi', 'username' => 'user@trustpilot.com', 'password' => 'P4ssw0rd' ]); //authenticate to get a valid token $trustpilotService->authenticate(); // if you use the same instance, once you have authenticated the service will automatically refresh the token when it is expired //get invitation templates $data = $trustpilotService->getInvitationTemplates(); var_dump($data['templates']);
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
PHP Package Boilerplate
This package was generated using the PHP Package Boilerplate by Beyond Code.
统计信息
- 总下载量: 212
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-09-22