Hello folks, I've just uploaded the newly rebuilt API manager for Trongate. It's now on GitHub. The API Manager is arguably the single most important feature of the entire Trongate website. That's because it's the feature that mobile users and JavaScript users are likely to be interested in, if they should ever consider using Trongate. The API manager that we had was good but it had/has the following issues:
  1. The JavaScript that we were using was super minified and virtually impossible to upgrade or even understand
  2. The API explorer used W3 CSS - a third party library
  3. The API manager did not adhere to RESTful URL patterns that are widely used across the industry
  4. The API manager was slightly over-engineered in places - for example, I built my own URL encode and decode functions (<--- which was really foolish since those features come built-in with PHP)
The new API manager addresses all of this. It also contains slightly more modern syntax by using things like the ternary operator, the null coalescing operator and the triple equals (instead of the double). As some of you will know, I'm the most anti-rewrite guy in the world. However, it's important for us to refrain from getting stuck with code that is hopelessly out of touch with the rest of the PHP community. So, one of the themes for the rest of the year will be the idea of gradually modernizing our syntax but without breaking stuff. There is just one potential breaking change that I'm aware of. If you happen to be doing GET requests that pass variables via the URL and you're unlucky enough to have strange variables being passed via the URL (such as underscores) then you may find that records are not being found. It's not a catastrophic error and I dare say it probably won't happen for anyone. However, if you run into any issues then I'm right here for you. This upgrade was pretty big. It involved writing about two thousand lines of PHP code and around a thousand lines of JavaScript. Even though I've bent over backwards to make this a non-breaking change, there is always a high chance of errors with an upgrade as big as this - particularly for the first few days. So, if you do spot anything wrong then please reach out to me and I promise I'll be on the case super fast. Enjoy the new API manager! DC