Not getting any response from the API
Closed this issue · 2 comments
Hello.
First of all, congrats and thanks for your work!
I have enabled the API in my shop and generated the keys then I tried to use it from an external app by installing the Rest Api Library and using the code but the script does not return anything at all.
Sometimes I get a 500 Server error.
I am struggling with this for almost a week now and getting pretty desperate.
I even installed a self-signed SSL, but no change...
This is a sample of code I use:
index->get() ); ?>I have tried many other variations with no luck either.
I also have to mention that the urls
http://www.myshop.com/wc-api/v1/
http://www.myshop.com/wc-api/v2/
http://www.myshop.com/wc-api/v3/
all display various json results, so that makes me think that the API itself works.
Can you please tell me what the heck am I doing wrong?
Thank you so much.
Andy.
It is possible that something on your site it triggering a error and causing the site to 500 when you call an endpoint.
Perhaps also give the official library a go and see if that works https://github.com/woocommerce/wc-api-php
Library works when ck_ and cs_ keys are for Admin and returns the std class object but when keys are for a different user returns Error: You do not have permission to read this product even when user has read/write privileges. and goes ahead to create the product in the database
$client->products->create($data);