Skip to content

Conversation

@skoop
Copy link

@skoop skoop commented Sep 19, 2024

What happened?

I was creating a ConfigurationVO object and I was setting the $apiVersion parameter to v2. When I then used the MastodonAPI object that I can created using the ConfigurationVO object, when I called (in my case) the /search endpoint, I got a 404 error from the API, because it was trying to call /api/v1/search. It did not respect the v2 I had set because the code was using the ConfigurationVO::API_VERSION constant, which is set to v1.

The solution

Instead of using the constant from the ConfigurationVO class, I use the $apiVersion property of the $this->config instead of the VO. Now, when I call the getPublicData('/search'), it respects the version and calls the v2 API.

@skoop
Copy link
Author

skoop commented Apr 15, 2025

Hi @colorfield! Any chance this could be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant