您好我正在研究houzz api我在邮递员中得到回应但是使用curl我没有得到任何回复得到空白页面。这是代码: -
$ch = curl_init();
$headers = array(
'X-HOUZZ-API-SSL-TOKEN: dfgs4g65sd4fg654a54rfg65df4g654a1',
'X-HOUZZ-API-USER-NAME: web_test',
'X-HOUZZ-API-APP-NAME: web_test');
curl_setopt($ch, CURLOPT_URL, "https://api.houzz.com/api?format=xml&method=getListing&ProductId=285599"); # URL to post to
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 ); # return into a variable
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); # custom headers, see above
$result = curl_exec( $ch ); # run!
curl_close($ch);
print_r($result);
在邮递员检查同样的东西时我得到了这些结果
<?xml version="1.0" encoding="utf-8"?>
<GetListingResponse>
<Ack>Error</Ack>
<Errors>
<Error>
<ErrorCode>25001</ErrorCode>
<ShortMessage>No Listing Found</ShortMessage>
<LongMessage>No listing was found with the given SKU or Product ID.</LongMessage>
</Error>
</Errors>
</GetListingResponse>
我也试过了curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
请帮助我谢谢。
答案 0 :(得分:0)
我在houzz api集成方面没有太多经验,但您的X-HOUZZ-API-SSL-TOKEN
应该看起来像这样fQABSAASACJHWADVGkK+2nYxxxxxxxxxxxxxERsq2foiU1+zAAMixxxxxxxxxxxxxJabw==
并尝试从请求中删除ProductId
参数。