I am calling Woo commerce’s API through a REST Client however the API is responding with 200 OK however the body (Should be JSON) is returning “1”.
the method i am calling is
Method: GET
URL: https://site/wc-api/v3/products?consumer_key=consumerkey&consumer_secret=consumersecret
Header: Accept: application/json;
The response;
response header:
- Status Code: 200 OK
- Connection: keep-alive
- Content-Encoding: gzip
- Content-Type: text/html
- Date: Wed, 16 Dec 2015 02:50:14 GMT
- Server: nginx/1.6.1
- Transfer-Encoding: chunked
- X-CF-Powered-By: WP 1.3.14
- X-Powered-By: PHP/5.4.32
response body: 1
- WC Version: 2.4.12
- WP Version: 4.3.1
I am not sure what the issue is, i have tried HTTPS using oAuth and HTTP using base Auth.
Thanks.
Ok, so i have found a solution…
The dev store is on a sub-domain (dev.site.com). The webserver was configured incorrectly and redirecting to the production site.
The production site was running an earlier version of WooCommerce – one that didn’t have version 3 of the API (The dev site had the latest version of WooCommerce).