vladyslav2019vladyslav2019 MemberComments: 1 Received thanks: 0 Member since: September 2019

The request is done to the api order endpoint /api/orders of just deployed Shopware 6 test shop site to the dev environment.

Postman is used. HTTP Basic authorization is used by request Authorization header with the value "Basic YXBpdXN...",

where YXBpdXN... is the base64 encoded value of “username:access-key-ID”.

access-key-ID is the Access key ID value, generated at the admin panel for the username user. Read and write permissions were given for the access key. Also that user was logged out / logged in.

The response of the request is:

{
    "errors": [
        {
            "code": "0",
            "status": "404",
            "title": "Not Found",
            "detail": "No route found for \"GET /api/orders\""
        }
    ]
}
Also the same No route found error is for any other api resource: articles, categories, etc, also for just the api endpoint.

Sending get request for just the domainname url responds with the correct html page.

Could you please help why the api resource routes are not found ?

Comments

  • Moritz NaczenskiMoritz Naczenski AdministratorsComments: 9924 Received thanks: 3009 Member since: September 2013
    Thanked by 1vladyslav2019
  • vladyslav2019vladyslav2019 MemberComments: 1 Received thanks: 0 Member since: September 2019

    @Morit@z Naczenski@ thanks a lot, now the route is found.

    But there is not authorized error now.
    {
        "errors": [
            {
                "code": "9",
                "status": "401",
                "title": "The resource owner or authorization server denied the request.",
                "detail": "The JWT string must have two dots"
            }
        ]
    }
    The token is correct totally. The Authorization header has the value "Basic YXBpdXN..." as described above.

    Could you please answer why this error occurs?

    I researched, found some issue but it seems to be a bit another one combined with Basic and Bearer Auth headers https://github.com/shopware/platform/issues/106 and there the shopware ticket was created https://issues.shopware.com/issues/NEXT-4243

  • derkurier2021derkurier2021 MemberComments: 2 Received thanks: 0 Member since: February 15

    If I try a request with GET https://myserver/api/v3/search/order I only get status "404" with "Nor route found for \"GET /api/v3/search/orders\"",

    My goal is to get a list of all orders via the REST-API-Call. The docu isn't right readable for me. All the example gives me "No route..." back

    getting the access token via request is simple right working with my PHP snippet and with postman, too. Any tips or ideas whats wrong and how to solve. Example request with json data is welcome. Thanks.

     

  • Moritz NaczenskiMoritz Naczenski AdministratorsComments: 9924 Received thanks: 3009 Member since: September 2013

    Just have a look at the request the admin sends to the server, the admin is using the api as well.

  • derkurier2021derkurier2021 MemberComments: 2 Received thanks: 0 Member since: February 15

    Hi Moritz. We solve the problem with the hoster maxcluster. There is a problem with the shopware 6 entwickler version. If you install it by docu you went into problems with REST calls after finsihing. It works only with the last stable version 6.3.5.1. With that version I am near at my goal to get all order data with calling the REST-API (:-))) Thanks for your help.

Sign In or Register to comment.