lujunsan / metabase-php-api
Metabase API 包装器
v1.0
2021-09-19 23:45 UTC
Requires
- ext-json: *
- guzzlehttp/guzzle: ^7.0
- phpfastcache/phpfastcache: ^8.0
README
这是一个用 PHP 编写的简单的 Metabase API 包装器。
安装
使用 composer 安装
composer require lujunsan/metabase-php-api
用法
使用以下方式创建 Metabase 客户端
/* * url: Full URL of the Metabase application (https://metabase.unicorn.com) * username: Username of the account that will make the API calls * password: Password of username above */ $client = new MetabaseClient($url, $username, $password);
使用以下方式从一个问题中检索数据
/* * questionId: Id of the question (query) that will be executed and retrieved * format: Optional, defaults as json * parameters: Optional, defaults empty, any extra parameters that will be sent in the API call */ $client->getQuestion($questionId, $format, $parameters);