@tsteur opened this Issue on June 2nd 2020 Member

This time it is SitesManager.getSiteFromId. Not sure if related to https://github.com/matomo-org/matomo/issues/16008

Request is eg

idSite=1&module=API&date=today&token_auth=YOURTOKEN&period=day&format=json&method=SitesManager.getSiteFromId&language=en&

It returns an object like this:

image

When it should return an array with one object in there.

This breaks for example the Matomo Mobile app.

Should this change be expected because of JSON2 being applied now, then we'd probably need to mention every API method whose output changes now.

@tsteur commented on June 11th 2020 Member

This is due to JSON2 becoming the default JSON format.

This breaking change might affect quite a few people...

I suppose the update strategy needs to be for people to switch to JSON2 format while they are on Matomo 3. They can then upgrade to Matomo 4. Thanks to https://github.com/matomo-org/matomo/pull/16029 things will still work. They can then change their code to use JSON format eventually.

Need to see if we can collect a list of APIs whose output is expected to change. And mention the above mentioned upgrade strategy as part of a migration guide.

@tsteur commented on June 12th 2020 Member

Other impacted API's:

  • API.getSettings
  • Annotations.get
  • Goals.getGoal
  • UsersManager.getUser
  • UsersManager.getUserByEmail
  • SitesManager.getSiteFromId
This Issue was closed on June 12th 2020
Powered by GitHub Issue Mirror