Detect Shopware Version through API

Hello,
Thank you in advance.

Is there any way to check Shopware version through API. for example shop URL - https://example.shop.com  is a running Shopware 5 or Shopware 6 without using any credentials.

You should be able to detect version in storefronts, by looking into the source.
For safety reasons there isn’t a safe way to detect version on default.

Additionally, there are Browser-Extensions trying to display what is running on sites.

What do you want with this information? :slight_smile:

2 „Gefällt mir“

@tinect schrieb:

Thank You so much for your help,

Actually i want to call API based on version as there is difference in API call and response in shopware 5 and shopware 6.

Hello,

I answered you on stackoverflow Detect Shopware Version through API - Stack Overflow

Best regards from Schöppingen

cool Michael Telgmann

1 „Gefällt mir“

@Michael Telgmann schrieb:

Hello, Michael Telgmann

Yes i have get help from your stackoverflow answer, than you so much

Hello Michael Telgmann,

I need one more help, is there any details documents for Shopware 6 API like of Shopware 5? for example. there are API docs to create product using API and Shopware is giving the format (Array format) to pass post data to the API while there is no specific format and informations for Shopware 6, have you anything that can help me please

Hi,

you can find our Docs here: https://docs.shopware.com/en/shopware-platform-dev-en/api
You could also use our Swagger Examples, just call „http://your-domain.com/api/v1/_info/swagger.html

Best regards from Schöppingen

cool Michael Telgmann

@Michael Telgmann schrieb:

Hi, Michael Telgmann

 

Thank you for your help but http://your-domain.com/api/v1/_info/swagger.html is return response like

{
    „errors“: [
        {
            „code“: „0“,
            „status“: „405“,
            „title“: „Method Not Allowed“,
            „detail“: „No route found for "POST /api/v1/_info/swagger.html": Method Not Allowed (Allow: GET)“
        }
    ]
}

as the error says, you try to make a POST request, you should use GET (as the error says)

@Michael Telgmann schrieb:

as the error says, you try to make a POST request, you should use GET (as the error says)

With the get method, it is saying    Unexpected 'in response

It’s HTML not JSON. You need to open it in your Browser.

@simkli schrieb:

It’s HTML not JSON. You need to open it in your Browser.

Thank you for your help, yes tried opening in browser but authorization header will be missing

You can get the exact Shopware 6 Version via getRequest to

api/v1/_info/config

 

 

2 „Gefällt mir“