2

Using the JSON RestAPI, I need to do things slightly differently depending on the version of Magento due to as-yet un-fixed bugs (specifically https://github.com/magento/magento2/issues/18005).

I can find the major and minor version numbers here

https://{{url}}/magento_version

but that doesn't have the build number, and could (should) be disabled in production.

As I currently use the JSON API, I was hoping for something there already, but can't see anything.

(I acknowledge I could build a custom API endpoint, but at present that's a little out of my knowledge after scanning some articles that explain how it all works, plus I might not be able to install that on all the Magento sites I will integrate with.)

So, my question is, with legitimate API access, how can I determine the version of a Magento installation?

  • You can create a simple module for it. – Milind Singh Sep 11 '18 at 10:40
  • I could, yes. As I said I could learn about how Magento works and create a custom endpoint, but a) that would take some time to do (I'm not against learning how to myself, just have a timeline) and b) I may not have the access or influence to get that module installed in third party sites. If that is the ONLY way, then I'll have to wing it... – KolonUK Sep 11 '18 at 13:24
  • How are you accessing API? because for authenticated access OAuth is must and it can only be done by creating an extension to be exact an integration. – Milind Singh Sep 11 '18 at 13:27
  • I'm using the JSON API, and I am assuming I will only have access to the endpoints available in the swagger documentation - none of which seem to offer a version. If at least one of the calls mentions a version, I could use that, but I'm starting to think it's a lost cause (what with all the other bugs I'm finding in Magento...) – KolonUK Sep 11 '18 at 13:48
  • Yes you are correct. If you are building an integration, then add a custom endpoint. – Milind Singh Sep 11 '18 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.