Webio
December 4, 2020, 10:11am
1
Hello,
is this normal that format type “php” has been removed from latest matomo 4.x version? I’m connecting to matomo using c# library from here:
(I know it was not updated for a long time but it worked up to latest 3.x version). When you look here:
you will see that sendRequest method is using:
string url = URL + "/?module=API&format=php";
but API returns that php value for format param is not valid.
Thanks
Lukas
(Lukas Winkler)
December 4, 2020, 10:58am
2
Hi,
Yes, it was intentionally removed:
opened 02:43PM - 12 Jun 15 UTC
closed 08:02PM - 22 Mar 20 UTC
Major
Task
Help wanted
A possible response format for APIs is in a PHP serialized string. This isn't go… od for many reasons:
- readable only by PHP
- prone to not work across systems or across time (e.g. differences between HHVM and the zend engine)
- very fragile (e.g. some plugin replace words in responses, this break this format)
- not standard at all (JSON, XML & co are more than enough for an HTTP API)
We could deprecate it for 3.0 and remove it later.
matomo-org:4.x-dev
← matomo-org:removephpformat
opened 01:06PM - 12 Feb 20 UTC
It is really weird that the C# API implementation is parsing a weird php-internal format instead of just requesting the data as JSON.
That said, you are probably faster if you know C# if you just write a bit of code that fetches the data from the API you need and uses the output than if you try to get this code, which is unmaintined for a long time, to work.
1 Like