Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of Wechat Intelligent Interface Development

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

What this article shares with you is an example analysis of Wechat intelligent interface development. The editor thinks it is quite practical, so I share it with you to learn. I hope you can get something after reading this article. Let's have a look with the editor.

Wechat open platform semantic understanding interface call (http request) is simple and convenient, users do not need to master semantic understanding and related technologies, just according to their own product characteristics, choose the corresponding services to build a set of intelligent semantic services.

Send a request for semantic understanding

Http request method: POST (please use https protocol) https://api.weixin.qq.com/semantic/semproxy/search?access_token=YOUR_ACCESS_TOKENPOST data format: JSONPOST data example: {"query": "check China Southern Airlines tickets from Beijing to Shanghai tomorrow", "city": "Beijing", "category": "flight,hotel", "appid": "wxaaaaaaaaaaaaaaaa", "uid": "123456"}

Parameter description

Whether or not the parameter type indicates that access_token is the tokenquery obtained by String according to appid and appsecret is the String input text string category is the service type that String needs to use, separated by ",", cannot see the Float latitude coordinates of the interface protocol document for empty latitude, which can be passed at the same time as the longitude; select one of the two input longitude from the city, see the interface protocol document Float longitude coordinates, and the latitude is imported at the same time Select one of the two imported city from the city to see the interface protocol document String city name, and select one of the two longitude and latitude from the input region to see the interface protocol document String area name, which can be saved in the presence of the city. Selecting one of the two input appid from longitude and latitude is the String official account * logo, which is used to distinguish official account developer uid or String user * id (non-developer id). Users can distinguish different users under official account (it is recommended to enter user openid). If it is empty, the context understanding feature cannot be used. Context understanding can only be used if both appid and uid exist at the same time.

Note: the intention of a single category is relatively clear, and the coverage identified is relatively large, so if you only use a specific category, it is recommended that category be set to that category only.

Description: under normal circumstances, Wechat will return the following JSON packet:

{"errcode": 0, "query": "check the tickets of China Southern Airlines from Beijing to Shanghai tomorrow", "type": "flight", "semantic": {"details": {"start_loc": {"type": "LOC_CITY", "city": "Beijing", "city_simple": "Beijing" "loc_ori": "Beijing"}, "end_loc": {"type": "LOC_CITY", "city": "city_simple": "Shanghai", "loc_ori": "Shanghai"} "start_date": {"type": "DT_ORI", "date": "2014-03-05", "date_ori": "tomorrow"}, "airline": "China Southern Airlines", "intent": "SEARCH"}

Return parameter description

Whether the parameter type is required. Errcode indicates that the status after the request is Int. Query is the input string for String users. Type is the global type id of String service. For more information, please see the vertical service agreement definition semantic in the agreement document. Semantic is the structural identity after semantic understanding of Object. Different services are different result No Array partial categories of results answer No String partial categories of results html5 display Text No String Special reply is not supported currently. The above is the example analysis of Wechat intelligent interface development. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report