Rebuilding LWT's API, part 2
Hi there! Much work has been done and the new LWT REST API is now ready! For records, the initial suggestion, formatted with the help of ChatGPT, looked like the following (see part 1 for details): 1. GET API Endpoints: - Get API Version: `GET /api/version` - Get Next Word to Test: `GET /api/test/next-word` - Get Tomorrow's Tests Number: `GET /api/test/tomorrow` - Get Phonetic Reading: `GET /api/text/phonetic-reading` - Get Theming Path: `GET /api/text/theme-path` - Get Texts Statistics: `GET /api/text/statistics` - Get Media Paths: `GET /api/media/paths` - Get Example Sentences: `GET /api/sentences/{word}` - Get Imported Terms: `GET /api/terms/imported` - Get Similar Terms: `GET /api/terms/{term}/similar` - Get Term Translations: `GET /api/terms/{term}/translations` 2. POST API Endpoints: - Update Reading Position: `POST /api/reading/position` - Add/Update Translation: `POST /api/translation/{word}` - Increment/Decrement Term Status: `POST /api/terms/{term}/status` - Set Term Status: `POST /api/terms/{term}/status/set` - Test Regular Expression: `POST /api/regexp/test` - Set Term Annotation: `POST /api/terms/{term}/annotation` - Save Setting: `POST /api/settings` It featured 11 endpoints on GET and 7 on POST. The key of this approach was it was not a fundamental change but rather a reorganization of the already existing AJAX requests. In fact, GPT do not have access to all the app information, as most endpoints are simply a simplification of the explanation sentence, and were sometimes optimistic or simply wrong: for instance GET /api/text/statistics, how are we supposed to know that we get statistics for a subset of texts here? ...