国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

微信獲取聊天記錄

獲取聊天記錄

1475200402638049.png

此接口返回的聊天記錄中,對(duì)于圖片、語(yǔ)音、視頻,分別展示成文本格式的[image]、[voice]、[video]。對(duì)于較可能包含重要信息的圖片消息,后續(xù)將提供圖片拉取URL,近期將上線。

調(diào)用說(shuō)明

1
2
3
4
5
6
7
8
9
 http請(qǐng)求方式: POST
https://api.weixin.qq.com/customservice/msgrecord/getmsglist?access_token=ACCESS_TOKEN
POST數(shù)據(jù)示例如下:
 {
    "starttime" : 987654321,
    "endtime" : 987654321,
    "msgid" : 1,
    "number" : 10000
}

參數(shù)說(shuō)明

參數(shù)說(shuō)明
starttime起始時(shí)間,unix時(shí)間戳
endtime結(jié)束時(shí)間,unix時(shí)間戳,每次查詢時(shí)段不能超過(guò)24小時(shí)
msgid消息id順序從小到大,從1開(kāi)始
number每次獲取條數(shù),最多10000條

返回說(shuō)明

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

18

19

20

21

 {
    "recordlist" : [
       {
          "openid" "oDF3iY9WMaswOPWjCIp_f3Bnpljk",
          "opercode" : 2002,
          "text" " 您好,客服test1為您服務(wù)。",
          "time" : 1400563710,
          "worker" "test1@test"
       },
       {
          "openid" "oDF3iY9WMaswOPWjCIp_f3Bnpljk",
          "opercode" : 2003,
          "text" "你好,有什么事情?",
          "time" : 1400563731,
          "worker" "test1@test"
       }

    ],

     "number":2,

     "msgid":20165267


 }

參數(shù)說(shuō)明

參數(shù)說(shuō)明
worker完整客服帳號(hào),格式為:帳號(hào)前綴@公眾號(hào)微信號(hào)
openid用戶標(biāo)識(shí)
opercode操作碼,2002(客服發(fā)送信息),2003(客服接收消息)
text聊天記錄
time操作時(shí)間,unix時(shí)間戳

返回碼說(shuō)明

返回碼說(shuō)明
65400API不可用,即沒(méi)有開(kāi)通或升級(jí)到新版客服功能
65416查詢參數(shù)不合法
65417查詢時(shí)間段超出限制

調(diào)用示例

第一次
請(qǐng)求:
https://api.weixin.qq.com/customservice/msgrecord/getmsglist
?access_token=ACCESS_TOKEN
POST數(shù)據(jù)示例如下:
 
{
    
"starttime" : 1464710400,
    
"endtime" : 1464796800,
    
"msgid" : 1,
    
"number" : 10000
}
 返回:
{
    
"recordlist"
 
: [
       
{
          
"openid"
 
: 
"oDF3iY9WMaswOPWjCIp_f3Bnpljk"
,
          
"opercode"
 
: 2002,
          
"text"
 
: 
" 您好,客服test1為您服務(wù)。"
,
          
"time"
 
: 1464710500,
          
"worker"
 
: 
"test1@test"
       
},
       
{
          
"openid"
 
: 
"oDF3iY9WMaswOPWjCIp_f3Bnpljk"
,
          
"opercode"
 
: 2003,
          
"text"
 
: 
"你好,有什么事情?"
,
          
"time"
 
: 1464710600,
          
"worker"
 
: 
"test1@test"
       
},
         ......
    
],
     "number":10000,
     "msgid":20165258
}

請(qǐng)求的number(10000)和返回的number(10000)一樣,該時(shí)間段可能還有聊天記錄未獲取,將msgid(20165258)填進(jìn)下次請(qǐng)求中;

  第二次
請(qǐng)求:
https://api.weixin.qq.com/customservice/msgrecord/getmsglist
?access_token=ACCESS_TOKEN
POST數(shù)據(jù)示例如下:
 
{
    
"starttime" : 1464710400,
    
"endtime" : 1464796800,
    
"msgid" : 20165258,
    
"number" : 10000
}
返回:
{
    
"recordlist"
 
: [
       
{
          
"openid"
 
: 
"oDF3iY9WMaswOPWjCIp_f3Bnpljk"
,
          
"opercode"
 
: 2002,
          
"text"
 
: 
" 您好,客服test1為您服務(wù)。"
,
          
"time"
 
: 1464710700,
          
"worker"
 
: 
"test1@test"
       
},
       
{
          
"openid"
 
: 
"oDF3iY9WMaswOPWjCIp_f3Bnpljk"
,
          
"opercode"
 
: 2003,
          
"text"
 
: 
"你好,有什么事情?"
,
          
"time"
 
: 1464710800,
          
"worker"
 
: 
"test1@test"
       
},
         ......
    
],
     "number":4,
     "msgid":20165267
}

請(qǐng)求的number(10000)和返回的number(4)不一樣,則該時(shí)間段的后續(xù)聊天記錄獲取完畢;