You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.
I have been using the API and would like to share some huge feedback and suggestions for improvement.
Status Codes and Error Messages:
I noticed that when there's an error in the API request, Anki returns a status code 200 with an error message. It would be more appropriate and consistent to utilize proper HTTP status codes for error responses, such as 400 (Bad Request) or 500 (Internal Server Error). This would help developers identify and handle errors more effectively.
Handling Empty Parameters:
Currently, it seems that the API does not allow sending "params": null when there are no parameters needed for a request. It would be more intuitive if the API allowed omitting the "params" field altogether for such cases, instead of forcing users to send an empty object. This would streamline the request process and make it more user-friendly.
Response Format for "getNumCardsReviewedByDay":
The response format for the "getNumCardsReviewedByDay" request includes data wrapped in an array, which might lead to confusion. Instead, using a JSON object for the response data would provide a clearer representation of the data being returned. And also would not mix different types in arrays which can lead to problems in static type languags.
I understand that developing and maintaining an open-source project can be challenging, and I want to express my willingness to help. But please, don't reinvent the wheel. The API is only usable with bad practice and huge workarounds (for example, wrong status/weird if else clauses based on the error field, bad structured json responses (not really deserializable out of the box)).
I believe addressing these issues would enhance the overall experience for AnkiConnect developers.
Best regards,
Daniél Kerkmann
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello AnkiConnect Developers,
I have been using the API and would like to share some huge feedback and suggestions for improvement.
Status Codes and Error Messages:
I noticed that when there's an error in the API request, Anki returns a status code 200 with an error message. It would be more appropriate and consistent to utilize proper HTTP status codes for error responses, such as 400 (Bad Request) or 500 (Internal Server Error). This would help developers identify and handle errors more effectively.
Handling Empty Parameters:
Currently, it seems that the API does not allow sending "params": null when there are no parameters needed for a request. It would be more intuitive if the API allowed omitting the "params" field altogether for such cases, instead of forcing users to send an empty object. This would streamline the request process and make it more user-friendly.
Response Format for "getNumCardsReviewedByDay":
The response format for the "getNumCardsReviewedByDay" request includes data wrapped in an array, which might lead to confusion. Instead, using a JSON object for the response data would provide a clearer representation of the data being returned. And also would not mix different types in arrays which can lead to problems in static type languags.
I understand that developing and maintaining an open-source project can be challenging, and I want to express my willingness to help. But please, don't reinvent the wheel. The API is only usable with bad practice and huge workarounds (for example, wrong status/weird if else clauses based on the error field, bad structured json responses (not really deserializable out of the box)).
I believe addressing these issues would enhance the overall experience for AnkiConnect developers.
Best regards,
Daniél Kerkmann
The text was updated successfully, but these errors were encountered: