WeChat Smart Interface

WeChat Smart Interface

WeChat open platform semantic understanding interface call (http request) is simple and convenient. Users do not need to master semantic understanding and related technologies. They only need to choose corresponding services according to their product characteristics to build a set of intelligent semantic services.

Send semantic understanding request

http request method: POST (please use https protocol)
https://api.weixin.qq.com/semantic/semproxy/search?access_token=YOUR_ACCESS_TOKEN

POST data format: JSON
POST data example:
  1. {
  2. "query":"Check China Southern Airlines tickets from Beijing to Shanghai tomorrow",
  3. "city":"Beijing",
  4. "category": "flight,hotel",
  5. "appid":"wxaaaaaaaaaaaaaaaaa",
  6. "uid":"123456"
  7. }

Parameter Description

parameter Is it necessary Parameter Type illustrate
access_token yes String Token obtained based on appid and appsecret
query yes String Input text string
category yes String The service type to be used. Multiple service types are separated by ",". They cannot be empty.
latitude See the interface protocol document Float Latitude coordinates, input together with longitude; or input one of the two coordinates, city
longitude See the interface protocol document Float Longitude coordinates, input at the same time as latitude; or input either latitude or city
city See the interface protocol document String Either the city name or the longitude and latitude is passed in
region See the interface protocol document String Region name, can be omitted if a city exists; can be passed in with latitude and longitude
appid yes String Official account *** logo, used to distinguish official account developers
uid no String User***id (not developer id), used to distinguish different users under the public account (it is recommended to fill in user openid). If it is empty, the context understanding function cannot be used. The context understanding function can only be used when both appid and uid exist.

Note: The intent of a single category is clearer and the recognition coverage is larger, so if you only need to use a specific category, it is recommended to set the category to that category only.

Return Description Under normal circumstances, WeChat will return the following JSON data packet:

  1. {
  2. "errcode":0,
  3. “query”: “Check China Southern Airlines tickets from Beijing to Shanghai tomorrow”,
  4. "type":"flight",
  5. "semantic":{
  6. "details":{
  7. "start_loc":{
  8. "type":"LOC_CITY",
  9. “city”:”Beijing”,
  10. "city_simple":"Beijing",
  11. “loc_ori”:”Beijing”
  12. },
  13. "end_loc": {
  14. "type":"LOC_CITY",
  15. “city”:”Shanghai”,
  16. "city_simple":"Shanghai",
  17. “loc_ori”:”Shanghai”
  18. },
  19. "start_date": {
  20. "type":"DT_ORI",
  21. "date":"2014-03-05",
  22. "date_ori":"tomorrow"
  23. },
  24. “airline”:”China Southern Airlines”
  25. },
  26. "intent":"SEARCH"
  27. }

Return parameter description

parameter Is it necessary Parameter Type illustrate
errcode yes Int Indicates the status after the request
query yes String User input string
type yes String The global type id of the service. For details, see the vertical service agreement definition in the agreement document.
semantic yes Object The structured markup after semantic understanding is different for each service
Result no Array Results for some categories
answer no String Some categories of results are displayed in HTML5, which is not currently supported
text no String Special reply instructions

For more details and protocol description, please see: Semantic Understanding Interface Protocol Documentation

<<:  WeChat Card and Coupon Interface

>>:  Seven questions to clarify the whole story of "WeChat charging"

Recommend

Kuaishou short video advertising platform gameplay + case introduction!

Kuaishou is a well-known short video application ...

For voice navigation, do you prefer Lao Luo or Lin Chiling?

Would you rather listen to Luo Yonghao’s voice nav...

Do you only use your microwave to heat up leftovers? You're missing out!

Microwave ovens, as lazy home appliances, bring c...

A guide to operating short videos on food “restaurant exploration”!

Open the current short video platforms, in additi...

Here are the top ten channels for APP promotion effectiveness!

I believe that many students who are responsible ...

Several strategies for good news marketing

In the increasingly competitive Internet, it is c...

Douyin e-commerce standardized product selection guide (recommended collection)

If you want to do well in Douyin live streaming s...

From martial arts novels to programmer interviews

[[140576]] summary Inspired by The Sword Stained ...

Two or three things you don’t know about new energy vehicles

Will new energy vehicles be the ultimate trend of...