Title: WordPress Api authentication error
Last modified: November 18, 2018

---

# WordPress Api authentication error

 *  [mridulcse](https://wordpress.org/support/users/mridulcse/)
 * (@mridulcse)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/wordpress-api-authentication-error/)
 * I am having this problem “{“code”:”woocommerce_rest_cannot_view”,”message”:”Sorry,
   you cannot list resources.”,”data”:{“status”:401}}..I found a a bunch of code
   for solution.
    But I don’t know where to use them inside WordPress ?
 * Codes:
    require “woocommerce_api”
 * woocommerce = WooCommerce::API.new(
    “[https://example.com&#8221](https://example.com&#8221);,“
   consumer_key”, “consumer_secret”, { wp_json: true, version: “wc/v1”, query_string_auth:
   true } )
 * Please help me
 * Thanks
    -  This topic was modified 7 years, 5 months ago by [mridulcse](https://wordpress.org/support/users/mridulcse/).

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/wordpress-api-authentication-error/#post-10893359)
 * I suggest you start over again with getting consumer key and secret. Follow the
   [instructions here](https://docs.woocommerce.com/document/woocommerce-rest-api/)
   very carefully.
 * Your code looks like it’s for the Ruby Client. Is Ruby something you are comfortable
   with using? While there’s nothing wrong with it if that’s what you are comfortable
   with, it’s somewhat of an unusual choice. Of course your choices depend on what
   you are developing for, of which I’ve no idea.

Viewing 1 replies (of 1 total)

The topic ‘WordPress Api authentication error’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [7 years, 5 months ago](https://wordpress.org/support/topic/wordpress-api-authentication-error/#post-10893359)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
