Title: Rest API Error
Last modified: August 10, 2020

---

# Rest API Error

 *  Resolved [erkangerici](https://wordpress.org/support/users/erkange/)
 * (@erkange)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/rest-api-error-15/)
 * 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)

 *  [AJ a11n](https://wordpress.org/support/users/amandasjackson/)
 * (@amandasjackson)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/rest-api-error-15/#post-13233547)
 * Hi [@erkange](https://wordpress.org/support/users/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](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](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](https://wordpress.org/support/users/erkange/)
 * (@erkange)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/rest-api-error-15/#post-13233617)
 * 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](https://wordpress.org/support/users/erkange/)
 * (@erkange)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/rest-api-error-15/#post-13234085)
 * 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.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [erkangerici](https://wordpress.org/support/users/erkange/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/rest-api-error-15/#post-13234085)
 * Status: resolved