matomo icon indicating copy to clipboard operation
matomo copied to clipboard

Provide non-200 error code when API method does not exist

Open diosmosis opened this issue 1 year ago • 2 comments

Summary

Currently when sending a request to the Matomo API with a method that does not exist, the HTTP response has a 200 response code but an error message saying the method does not exist. For easier automated detection of this specific error, it would be useful if the response code was a specific error code (like bad request for example).

(Note for prioritisation: should be a quick change, but not needed, would be nice to have.)

diosmosis avatar Oct 23 '23 07:10 diosmosis

Hi, is this issue still open?

camicacace avatar Apr 21 '24 23:04 camicacace

Hi @camicacace, yes, the issue is still open and we'd welcome a PR if you wanted to have a go at creating one.

michalkleiner avatar Apr 22 '24 00:04 michalkleiner

@michalkleiner I believe this issue has been solved, not sure which PR fixed it but on my local dev copy I seem to be able to elicit the desired behavior. Should we close the issue?

Screenshot 2024-09-27 at 16 52 40

jsantos42 avatar Sep 27 '24 14:09 jsantos42

It indeed had been fixed, @jsantos42, via https://github.com/matomo-org/matomo/pull/22334. Thanks for the follow up, I'll close this issue now.

michalkleiner avatar Sep 27 '24 15:09 michalkleiner