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

WeChat Mini Programs message Analysis data Interface how to call

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly explains "how to call WeChat Mini Programs message analysis data interface". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. let's study and learn "how to call WeChat Mini Programs message analysis data interface".

Please note:

1. Only the data after December 1, 2014 is stored in the official account database on the interface side, and the date before that will not be queried. Even if it is found, it is also unreliable dirty data.

2. Developers are asked to save the data in their own database after calling the API to obtain data, which not only speeds up the next user's access speed, but also reduces the unnecessary loss of Wechat API calls.

Message analysis data API refers to the interface used to obtain message analysis data in the data statistics module of the official website of the public platform. The specific API list is as follows (no message keyword data API):

API name * time span API call address (must use https) get message delivery overview data (getupstreammsg) 7 https://api.weixin.qq.com/datacube/getupstreammsg?access_token=ACCESS_TOKEN get message delivery time-sharing data (getupstreammsghour) 1 https://api.weixin.qq.com/datacube/getupstreammsghour?access_token=ACCESS_TOKEN get message delivery week data (getupstreammsgweek) 30 https://api.weixin.qq.com/datacube/getupstreammsgweek? Access_token=ACCESS_TOKEN get message delivery monthly data (getupstreammsgmonth) 30 https://api.weixin.qq.com/datacube/getupstreammsgmonth?access_token=ACCESS_TOKEN get message delivery distribution data (getupstreammsgdist) 15 https://api.weixin.qq.com/datacube/getupstreammsgdist?access_token=ACCESS_TOKEN get message delivery distribution week data (getupstreammsgdistweek) 30 https://api.weixin.qq.com/datacube/getupstreammsgdistweek?access_token=ACCESS_TOKEN get message delivery distribution monthly data (getupstreammsgdistmonth ) 30 https://api.weixin.qq.com/datacube/getupstreammsgdistmonth?access_token=ACCESS_TOKEN

* time span refers to the time range within which data can be obtained when an API is called. For example, a time span of 7 means to obtain data for up to 7 days at a time. The actual value of access_token can be obtained by "get access_token".

For weekly and monthly data, please note that the data of each month / week is dated on the * * day of the current month / week (1st or Monday of the current month). Call the API after a certain month / week to get the data of the cycle. For example, if you call the API for obtaining monthly data on December 1 (November 1-November 5) as (begin_date and end_date), you can get the monthly data up to November 1 (that is, November monthly data).

API call request description

The message analysis data interface (including all interfaces in the interface list) needs to call the address POST the following sample packet to the appropriate interface:

{"begin_date": "2014-12-07", "end_date": "2014-12-08"}

Call parameter description

Whether the parameter must indicate whether access_token is the start date of calling API credential begin_date to obtain data, and the difference between begin_date and end_date must be less than "* time span" (for example, when * time span is 1, the difference between begin_date and end_date can only be 0, which can be less than 1), otherwise it will be reported that end_date is the end date of data acquisition, and the value allowed by end_date is yesterday.

Return description

To get the message sending overview data API, you need to call the address POST the following packets to the corresponding interface:

{"list": [{"ref_date": "2014-12-07", "msg_type": 1, "msg_user": 282, "msg_count": 817} / / there are data from different msg_type of the same ref_date And data of different ref_date (within the time range)}

To get the message distribution time-sharing data interface, you need to call the address POST the following packets to the corresponding interface:

{"list": [{"ref_date": "2014-12-07", "ref_hour": 0, "msg_type": 1, "msg_user": 9, "msg_count": 10} / / followed by data from different msg_type of the same ref_hour And data of different ref_hour, fixed by ref_date Because * the time span is 1]} the JSON packets returned by the API for obtaining message sending week data are as follows: {"list": [{"ref_date": "2014-12-08", "msg_type": 1, "msg_user": 16 "msg_count": 27} / / followed by data of different msg_type under the same ref_date And data of different ref_date]}

The return JSON packet of the API that gets the monthly data of message delivery is as follows:

{"list": [{"ref_date": "2014-11-01", "msg_type": 1, "msg_user": 7989, "msg_count": 42206} / / there are data of different msg_type and different ref_date under the same ref_date]}

The return JSON packet of the API for getting message sending distribution data is as follows:

{"list": [{"ref_date": "2014-12-07", "count_interval": 1, "msg_user": 246} / / followed by data of different count_interval and different ref_date under the same ref_date]}

The return JSON packet of the data API that gets the message sending distribution week is as follows:

{"list": [{"ref_date": "2014-12-07", "count_interval": 1, "msg_user": 246} / / followed by data of different count_interval and different ref_date under the same ref_date]}

The return JSON packet of the API for getting message sending distribution month is as follows:

{"list": [{"ref_date": "2014-12-07", "count_interval": 1, "msg_user": 246} / / followed by data of different count_interval and different ref_date under the same ref_date]}

Return parameter description

The parameter indicates the date of the ref_date data, including the hours of ref_hour data between begin_date and end_date, ranging from 000 to 2300, representing [000100) to [2300 msg_type 2400), that is, the first hour of the day and * 1 hour of the day. The message types are as follows:

1 for text 2 for picture 3 for voice 4 for video 6 for third party application message (link message)

The number of users who sent messages (sent to the official account) on msg_user uplinks. The total number of messages sent on the msg_count uplink. Count_interval sent messages in the range of the distribution of messages sent on the current day. 0 represents "0", 1 represents "1-5", and 2 represents "6-10". 3 represents the number of times to read the int_page_read_count page "more than 10 times". The number of readers on the ori_page_read_user original page (click on the page "read the original text"). When there is no original page, the data here is zero. Thank you for your reading. This is the content of "how to call WeChat Mini Programs's message Analysis data Interface". After the study of this article, I believe you have a deeper understanding of how to call WeChat Mini Programs's message analysis data interface, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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