WooCommerce-REST-API-Client-Library
WooCommerce-REST-API-Client-Library copied to clipboard
Woocommerce REST API Oauth consumer key parameter is missing
Hi Kloon,
I have a WooCommerce website and I am building an hybrid app for it (HTML, ANGULARJS). I need to get the products from the website to show into the app and I am using your REST API PHP Client Library for that.
The website is online and the app at the moment is on my local machine. It is not clear to me where to exactly put the library. I have placed it on the server in the website's root:
root
- lib
- example
- example.php (in here there is my URL and keys generated from the website's woocommerce admin panel)
I need to get the products from the app with a http get request ($http.get("//www.example.com/wc-api/v3/products/" + $id)) so for example if I need a product with id=1 I would need to go to this URL http://example.com/wc-api/v3/products/1
but when I go there I get the error
{"errors":[{"code":"woocommerce_api_authentication_error","message":"oauth_consumer_key parameter is missing"}]}
What am I doing wrong? Am I placing the library in the wrong place? Can you please advice? I have looked and asked everywhere but I didn't get any reply and I don't know where else to look.
I really hope you can advice me on this!
Many thanks, Jeff
I have to add that if I now go to http://example.com/example/example.php I do get the list of all the products, which I believe that the API and the library are working fine. I just don't understand how to get the individual products since I get a woocommerce_api_authentication_error.
Thank you
How do you manage to get the list of all products (is it in JSON ? )