In recent years, more and more people are using WeChat official accounts, and our lifestyles have also undergone tremendous changes.
Kintone is naturally not to be left behind and keeps up with the times.
This article will introduce you to the method of retrieving kintone record information in the WeChat public account.
To put it simply, we will create a new application for managing corporate information in kintone, and then enter keywords in the WeChat official account to retrieve the information in the application.
Since the official public account requires certification, this time we temporarily use the WeChat public account test account.
After the application is successfully created, enter three pieces of data
1. VisitWeChat public platformand click "Enter the WeChat public account test account application system" and apply for the WeChat public account test account
2. Enter the WeChat public test account
for testing In the account management page, we can see the appID and appsecret. Write down these two pieces of information, it will be useful later.
3. Fill in the interface configuration information
This information requires its own server resources. There are many cloud server resources online, and everyone can choose freely.
If you have a server with a public IP, you can also use it. Below we mainly use the PHP environment (the specific server configuration method is omitted)
Next, write the server verification code to make it Can correctly respond to the Token verification sent by WeChat. For details, please refer toAccess Guide.
##Code
class WeChat { private $_appid; private $_appsecret; private $_token; public function __construct($appid, $appsecret, $token) { $this->_appid = $appid; $this->_appsecret = $appsecret; $this->_token = $token; } public function valid() { $echoStr = $_GET["echostr"]; //valid signature , option if($this->checkSignature()) { echo $echoStr; exit; } } private function checkSignature() { $signature = $_GET["signature"]; $timestamp = $_GET["timestamp"]; $nonce = $_GET["nonce"]; $token = $this->_token; $tmpArr = array($token, $timestamp, $nonce); sort($tmpArr); $tmpStr = implode( $tmpArr ); $tmpStr = sha1( $tmpStr ); if( $tmpStr == $signature ) { return true; } else { return false; } } }
php documentationandkintone API: Get records in batches (specify conditions in the query).
WeChat public platform technical documentation
Field name | Field code | Remarks | |
---|---|---|---|
Creator | Creator | ||
Creation Time | Creation time | ||
Company name | company | Set as required | The value is unique |
Company representative | representative | ||
Region | area | ||
Location | address | ||
Company phone number | tel |
The above is the detailed content of How to retrieve kintone record information in WeChat. For more information, please follow other related articles on the PHP Chinese website!