matchtune-sdk / php-sdk
访问 MatchTune API 的框架库
1.0
2021-09-27 13:00 UTC
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2024-09-27 20:54:10 UTC
README
此存储库包含开源 MatchTune SDK,允许您从您的 PHP 应用程序中访问 MatchTune API。
安装
MatchTune PHP SDK 可以通过 Composer 安装。运行以下命令:
composer require matchtune-sdk/php-sdk
使用方法
简单的 MatchTune 查询示例
require_once __DIR__ . '/vendor/autoload.php'; // change path as needed use MatchTune\MatchTune; $api = new MatchTune(["app_token" => $app_token]); $haserror = true; // -- Load genre & subgenre list if ($genres = $api->genres()) { // -- pick a random genre $genre = $genres[array_rand($genres)]; // -- create a search query $query = $api->makeQuery($genre, $title = null, $tags = null); // -- request a standard generated music if ($idcard = $api->generate($query)) { $haserror = false; // -- use the data printIDCard($idcard); } }
API 文档
我们在这里开发的所有机制都在我们的 REST API 文档 中进行了文档化。
许可协议
有关更多信息,请参阅 许可文件。
安全漏洞
如果您发现了一个安全问题,请直接通过 support@matchtune.com 联系支持团队。