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

API.get output: also return the website URL field 'main_url' #6787

Closed
mattab opened this issue Dec 2, 2014 · 10 comments
Closed

API.get output: also return the website URL field 'main_url' #6787

mattab opened this issue Dec 2, 2014 · 10 comments
Assignees
Labels
answered For when a question was asked and we referred to forum or answered it. c: Usability For issues that let users achieve a defined goal more effectively or efficiently. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Dec 2, 2014

The goal of this issue is to make a small improvement to the API.get API method and let it return the main URL of the website as well.

@mattab mattab added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. c: Usability For issues that let users achieve a defined goal more effectively or efficiently. labels Dec 2, 2014
@mattab mattab self-assigned this Dec 2, 2014
@mattab mattab added this to the Piwik 2.10.0 milestone Dec 2, 2014
@diosmosis
Copy link
Member

Could you use bulk request w/ API.get & SitesManager.getSiteFromId?

@mattab
Copy link
Member Author

mattab commented Dec 3, 2014

it can also be done with something like in MultiSites API maybe: $dataTable->filter('ColumnCallbackAddMetadata', array('label', 'main_url', array('\Piwik\Site', 'getMainUrlFor'), array()));

@diosmosis
Copy link
Member

I mean instead of modifying API.get result, having the user use a bulk request. Otherwise, since the site id is stored in DataTable metadata, perhaps a filter invoked by a query parameter might be a good idea so the solution is more generic.

@mattab
Copy link
Member Author

mattab commented Dec 3, 2014

perhaps a filter invoked by a query parameter might be a good idea so the solution is more generic.

👍

@mattab mattab removed their assignment Dec 5, 2014
@tsteur
Copy link
Member

tsteur commented Dec 5, 2014

+1 for actually using bulk requests and not a query param. At some point we'd end up in a huge mess ;) That's exactly what bulk requests is intended for. It should be even possible to use show/hideColumns along getSiteFromId to only request main_url etc. The single API's have to be simple and shouldn't have hacks ;) Rather write a plugin and add a new API or whatsoever.

@mattab
Copy link
Member Author

mattab commented Dec 7, 2014

goal of the user is to have the main_url field in the same response as where the data is. using bulk request user would have to merge the data manually... in this case maybe adding a new parameter to decorate with the Website URL would be better?

@tsteur
Copy link
Member

tsteur commented Dec 7, 2014

No. Having to merge data is totally acceptable. If we do this for every user we end up in a huge mess etc. and it would totally go against the purpose of those API's

@mattab
Copy link
Member Author

mattab commented Dec 8, 2014

User wants Excel report - how can he merge the data? maybe then we
really have to build a little custom plugin for that...

@tsteur
Copy link
Member

tsteur commented Dec 8, 2014

Yes!

@mattab mattab self-assigned this Dec 8, 2014
@mattab
Copy link
Member Author

mattab commented Dec 9, 2014

@tsteur Ok makes sense, we keep the platform lean and do all kind of hacks or special requirements in plugins 👍

See: plugin for Piwik that modifies the 'API.get' output to also list the website name and main website URL. #6828

@mattab mattab closed this as completed Dec 9, 2014
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Dec 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it. c: Usability For issues that let users achieve a defined goal more effectively or efficiently. 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