tips-1048079-03.php // 请求头部$header = array( "Host: " . $this-_subDomain . ".cybozu.com:443", "X-Cybozu-API-Token: " . $this-_apiToken);$queryStr = 'company like "'. $keyword. '"';$params = "?app=$this-_appIdquery=".urlencode($queryS
// 请求头部 $header = array( "Host: " . $this->_subDomain . ".cybozu.com:443", "X-Cybozu-API-Token: " . $this->_apiToken ); $queryStr = 'company like "'. $keyword. '"'; $params = "?app=$this->_appId&query=".urlencode($queryStr) . "&fields[0]=". urlencode("company") . "&fields[1]=". urlencode("representative") . "&fields[2]=". urlencode("area") . "&fields[3]=". urlencode("address") . "&fields[4]=". urlencode("tel"); $url = "https://" . $this->_subDomain . ".cybozu.com/k/v1/records.json". $params; $response = $this->_request($url, true, "get", null, $header); //curl提交 $result = json_decode($response, true); if (count($result["records"]) > 0) { foreach($result["records"] as $value) { if ($contentStr != '') { $contentStr .= "\n\n"; } $contentStr .= "公司名:". $value["company"]["value"]."\n" . "公司代表:". $value["representative"]["value"]."\n" . "地域:". $value["area"]["value"]."\n" . "所在地:". $value["address"]["value"]."\n" . "电话:". $value["tel"]["value"]; } } else { $contentStr = "未找到该企业信息"; }