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

Google Tasks launches on Android and iOS

It may not be a secret that Google has its own to...

Planning activities: 4 efficient promotion methods

This time, the editor would like to share with yo...

What enlightenment can the insomniac eyeless fish bring us?

© Kuttelvaserova Stuchelova/Shutterstock Leviatha...

Android M full name Android Marshmallow

Last week, Google released a promotional video fo...

APP promotion: How to cultivate core users!

Why do you want to be a core user? What is the ul...

Where will the next big battle between Apple and Google be?

July 7, 2019: In recent years, the battle lines b...

Why do some people get tanned when exposed to the sun, while others get red?

Reviewer of this article: Zhou Xiaobo, Doctor of ...

6 ways to attract new users!

Today's article would like to explain to you ...