# Configuration information
For example:
APPID: xxxxxxxxxxxxxxx
TOKEN: xxxxxxxxxxxxxxx
EncodingAESKey: xxxxxxxxxxxxxxx
# Interface information
# Dialog recommendation interface(Only signature, not encryption.):
https://chatbot.weixin.qq.com/openapi/nlp/recommend_questions/TOKEN
Interface type:
POST Request
# Dxplaination of parameters:
field | type | Default value | describe |
---|---|---|---|
query | string | Data after signing with JWT |
Query signature explaination:
field | type | Default value | describe |
---|---|---|---|
uid | string | Automatically generated random identifiers | Unique ID of the user's identity, such as: openid |
data | Object | {} | Data is empty |
useJSON Web Tokenof HS256
The algorithm encodes the parameters, Into the query parameter.
For example, the parameters are
{
uid: "xjlsj33lasfaf", //Unique user id that identifies the user, which can be openid
data: {}
}
use jwt and EncodingAESKey
Encode the data object to get the encrypted character string
const signedData = jwths256.encode(EncodingAESKey, {
uid: "xjlsj33lasfaf", //Unique user id that identifies the user, which can be openid
data: {}
}
)
# Calling the Open Platform Semantic Interface
curl -XPOST -d "query=signedData" https://chatbot.weixin.qq.com/openapi/nlp/recommend_questions/TOKEN
<a url=http://www.jsonwebtoken.io/" target="_blank">https://www.jsonwebtoken.io/
Tips: in jsonwebtoken.io You can manually generate signedData using the following steps
# Return value:
field | type | describe |
---|---|---|
results | Array | Character string array, recommend up to 5 questions to ask the robot. |
# Return format:
{
"results": [
" In weixin H5 payment, how to judge the success of payment in the service end? " ,
"the transaction funds are inconsistent with the settlement funds."
"modify settlement account,"
"Data View,"
"weixin Pay Merchant Self-Inspection Guidelines"
]
}