简体   繁体   English

WooCommerce REST API请求返回错误

[英]WooCommerce REST API request returns error

I'm developing a shopping cart Site and an App. 我正在开发一个购物车网站和一个应用程序。 I want to get product details from DB for my App, So I have recently used JSON REST API (WP API), And also latest version of WooCommerce 2.1. 我想从数据库获取有关我的应用程序的产品详细信息,所以我最近使用了JSON REST API(WP API),以及最新版本的WooCommerce 2.1。

When I run my url http://ishop/wc-api/v1/ I get a long json output, So I can make sure the API is working fine. 当我运行url http://ishop/wc-api/v1/我得到了一个很长的json输出,因此我可以确保API正常运行。

However when I pass a request like this: 但是,当我通过这样的请求时:

http://ishop/wc-api/v1/products?consumer_key=ck_asd78465&consumer_secret=cs_d75412

Error: 错误:

{"errors":[{"code":"woocommerce_api_authentication_error","message":"oauth_consumer_key parameter is missing"}]}

Anything wrong in my syntax? 我的语法有问题吗? Please help guys. 请帮助大家。

You have to use ether HTTPS or a OAuth signature as described here: http://woothemes.github.io/woocommerce/rest-api/#authentication 您必须按照此处所述使用以太HTTPS或OAuth签名: http : //woothemes.github.io/woocommerce/rest-api/#authentication

There is a client library that can help you with the signature if you want to use HTTP. 如果要使用HTTP,则有一个客户端库可以帮助您进行签名。 You can find the library here: https://github.com/kloon/WooCommerce-REST-API-Client-Library 您可以在这里找到该库: https : //github.com/kloon/WooCommerce-REST-API-Client-Library

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM