matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.78k stars 2.63k forks source link

Live.getLastVisitsDetails and RSS format #13195

Open fdellwing opened 6 years ago

fdellwing commented 6 years ago

In https://github.com/matomo-org/matomo/issues/9840#issuecomment-188206177 @tsteur said, that it is normal that the RSS feature does not work, but I do not buy this.

Why is this API call not working? https://demo.matomo.org/?module=API&method=Live.getLastVisitsDetails&idSite=7&period=day&date=today&format=rss&token_auth=anonymous&translateColumnNames=1

Error: RSS feeds can be generated for one specific website &idSite=X.
Please specify only one idSite or consider using &format=XML instead.

There is definitely an idSite=7 present in the url. This is also shown when you change the id to 1. It than tells you:

Error: You can't access this resource as it requires 'view' access for the website id = 1.
sgiehl commented 6 years ago

The error message might be a bit missleading. RSS renderer can't currently be used for API calls returning multiple datatables (range requests) or results not indexed by date. See https://github.com/matomo-org/matomo/blob/3.x-dev/core/DataTable/Renderer/Rss.php#L46-L51

Not sure if some of that restrictions could be removed. I've you are keen to check that @fdellwing, feel free and do ahead :slightly_smiling_face: