lfybk666/api
Composer 安装命令:
composer require lfybk666/api
包简介
Example api
README 文档
README
PHP library for Example API interaction, includes Auth authorization and API methods.
1. Prerequisites
- PHP 8.2
2. Installation
The Example Api can be installed using Composer by running the following command:
composer require lfybk666/api
3. Initialization
Create ApiClient object using the following code:
$api = new \Lfybk666\Api\Client\ApiClient();
4. Authorization
The library provides the authorization by secret api token.
4.1. Authorization Code Flow
Auth Authorization Code Flow allows calling methods from the server side.
Create Auth object first:
$auth = new \Lfybk666\Api\Auth\Auth();
4.1.1. For getting user access key use following command:
$auth = new \Lfybk666\Api\Auth\Auth(); $accessToken = $auth->getAccessToken('example_api_key');
5. API Requests
5.1. Request sample
Example of calling method comments.get:
$apiClient = new ApiClient(); $comments = $apiClient->comments()->get($accessToken, [ 'page' => 1, ]);
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-only
- 更新时间: 2024-06-03