2017-12-02 72 views

回答

0

喬, 我做一個小測試,這是你需要做的的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 

如果沒有電子郵件存在,則返回一個空數組。

+0

你好瑞克,我會測試你的解決方案。如果我理解的很好,我的問題與編碼%40而不是@有關。我會檢查並給你反饋。 非常感謝! –

+0

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沒有任何返回。很奇怪 ... –