woocommerce REST API通过电子邮件
问题描述:
得到客户找客户通过电子邮件woocommerce REST API通过电子邮件
https://localhost/biobays/wp-json/wc/v2/customers/2让客户通过ID工作。但是 https://localhost/biobays/wp-json/wc/v2/customers/email/[email protected]或https://localhost/biobays/wp-json/wc/v2/[email protected]不工作
我希望检索用户信息。
我有一个空的回应。
PS:这项工作的老V3大https://localhost/biobays/wc-api/v3/customers/email/[email protected]
答
乔, 我做一个小测试,这是你需要做的的API调用:
$params = array("email" => "[email protected]");
$getContact = $wcApi->get('customers',$params);
echo "<pre>";
print("<pre>".print_r($getContact , true)."</pre>");
echo"</pre>";
如果将测试url打电话如下:
https://localhost/biobays/wp-json/wc/v2/customers?email=test%40t.com&consumer_key=YOUR_CONSUMER_KEY&consumer_secret=YOUR_CONSUMER_SECRET
如果没有电子邮件存在,则返回一个空数组。
你好瑞克,我会测试你的解决方案。如果我理解的很好,我的问题与编码%40而不是@有关。我会检查并给你反馈。 非常感谢! –
Hi Rick,https:// localhost/biobays/wp-json/wc/v2/customers?email = test%40t.com&consumer_key = YOUR_CONSUMER_KEY&consumer_secret = YOUR_CONSUMER_SECRET与curl一起工作得很好,但Alamofire没有任何返回。很奇怪 ... –