lujunsan/metabase-php-api

v1.0 2021-09-19 23:45 UTC

This package is auto-updated.

Last update: 2024-04-20 05:54:04 UTC


README

Simple Metabase API wrapper written in PHP.

Installation

Install with composer:

composer require lujunsan/metabase-php-api

Usage

Create a Metabase Client with:

/*
 * 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);

Retrieve data from a question with:

/*
 * 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);