Support » Plugin: WooCommerce » Rest API Error

  • Resolved erkangerici

    (@erkange)


    Everything was working, then i moved my website to another server.
    Now getting this error.

    {
      "code": "woocommerce_rest_cannot_view",
     “message”: “Sorry, you cannot list resources.”,
      "data": {
        "status": 401
      }
    }

    I am sure that user name and password is correct. It was working just yesterday.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support AJ a11n

    (@amandasjackson)

    Hi @erkange

    The response indicates that you are not authorized for that REST endpoint.A 401 error means that you’ve got bad credentials and are using the wrong API keys: https://woocommerce.github.io/woocommerce-rest-api-docs/#errors

    Please review the documentation once more, from here: https://woocommerce.github.io/woocommerce-rest-api-docs/#authentication

    Ensure that if you are using “Basic auth” that https is used for the connection, and that the user creating the REST API keys have both read/write permissions.

    Thread Starter erkangerici

    (@erkange)

    I do test with imsomnia, using exactly same settings with yesterday.
    Also same user and same pass.

    No luck.

    Then created another api and having same error.
    It was working yesterday in another server.

    Do you know if anything need to update in hosting?

    Thread Starter erkangerici

    (@erkange)

    I have added this to first line of .htaccess file and it is solved.

    SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

    Like i mentioned it was not user name or password issue, i have changed server and it happened.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Rest API Error’ is closed to new replies.