Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a library to query the PHP Reporting API #7268

Open
tsteur opened this issue Feb 22, 2015 · 0 comments
Open

Provide a library to query the PHP Reporting API #7268

tsteur opened this issue Feb 22, 2015 · 0 comments
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Comments

@tsteur
Copy link
Member

tsteur commented Feb 22, 2015

While reading a Reporting API guide I did notice that we recommend to include our index.php into another project in order to use our PHP Reporting API Client. We also do link from the http://piwik.org/integrate page to this guide and promote it like this:

Piwik is written in PHP5, it is possible to use the underlying PHP classes directly within your project, making it easy to use and call the Piwik APIs.

I know because of defining all those constants in the example we do not actually overwrite error handlers etc and it isn't that bad therefore but still people need to call the init() method of the FrontController. Meaning it can be used in an application only if there's also a Piwik installation on the same server. It will load the config, all plugins, create an instance of the database etc just to create an API request. This is no good and not really useful for any PHP application. I would personally remove this from the Integrate page or at least explain in the guide what is happening there (we already explain it can be only used when Piwik is on the same server) but this is not what this issue is about.

Let's provide a proper Reporting API library that calls Piwik via HTTP similar to the PiwikTracker and that can be used standalone. If this does not have any priority (which I presume) let's maybe create a repository for it and tweet / post on facebook whether someone is keen on writing one. To keep things similar the library could only generate URL's but not send the request. Eg

$api = new PiwikReportingApi('http://demo.piwik.org');
$api->authenticate('123token');
$api->setMethod('API.getReportMetadata');
$url = $api->getUrl();

I didn't really think seriously about the API. I think there are already quite a few Reporting API libraries where one can have a look for some ideas for a good API

@mattab mattab added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. labels Apr 8, 2015
@mattab mattab added this to the Mid term milestone Apr 8, 2015
@mattab mattab added the Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. label Apr 8, 2015
@mattab mattab added duplicate For issues that already existed in our issue tracker and were reported previously. and removed Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. labels Dec 5, 2016
@mattab mattab modified the milestones: Long term, Mid term Dec 5, 2016
@mattab mattab removed the duplicate For issues that already existed in our issue tracker and were reported previously. label Dec 5, 2016
@innocraft-automation innocraft-automation removed this from the Backlog (Help wanted) milestone Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

3 participants