WeChat customer service management


Customer Service Management

1475199575177944.jpg


##Get basic customer service information

Call instructions

1
2
http request method: GET
##https://api.weixin.qq.com/ cgi-bin/customservice/getkflist?access_token=ACCESS_TOKEN

Return instructions

Return data example (JSON return result when correct):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
    "kf_list" : [
       {
          "kf_account" : "test1@test",
          "kf_headimgurl" : "http://mmbiz.qpic.cn/mmbiz/4whpV1VZl2iccsvYbHvnphkyGtnvjfUS8Ym0GSaLic0FD3vN0V8PILcibEGb2fPfEOmw/0",
          "kf_id" : "1001",
          "kf_nick" : "ntest1",
          "kf_wx" : "kfwx1"
       },
       {
          "kf_account" : "test2@test",
          "kf_headimgurl" : "http://mmbiz.qpic.cn/mmbiz/4whpV1VZl2iccsvYbHvnphkyGtnvjfUS8Ym0GSaLic0FD3vN0V8PILcibEGb2fPfEOmw/0",
          "kf_id" : "1002",
          "kf_nick" : "ntest2",
          "kf_wx" : "kfwx2"
       },
       {
          "kf_account" : "test3@test",
          "kf_headimgurl" : "http://mmbiz.qpic.cn/mmbiz/4whpV1VZl2iccsvYbHvnphkyGtnvjfUS8Ym0GSaLic0FD3vN0V8PILcibEGb2fPfEOmw/0",
          "kf_id" : "1003",
          "kf_nick" : "ntest3",
          "invite_wx" : "kfwx3",
          "invite_expire_time" : 123456789,
          "invite_status" : "waiting"
       }
    ]
 }

Parameter description

##ParameterDescription##kf_accountkf_nick kf_idCustomer service number##invite_expire_time##invite_status The status of the invitation includes "waiting" waiting for confirmation, "rejected" being rejected,


##Get basic customer service information

Call instructions

Complete customer service account, the format is: account prefix@public account WeChat ID
Customer service nickname
kf_headimgurlCustomer service avatar
kf_wx

If the customer service account has been bound Customer service staff's WeChat ID,

The WeChat ID is displayed here

invite_wx

If the customer service account has not been bound to WeChat ID , but a binding invitation has been initiated,

The WeChat ID of the binding invitation is displayed here

If the customer service account has not been bound to WeChat ID, but a bound invitation has been initiated,

The expiration time of the invitation is the unix timestamp

expired "expired"

Return description

1
2
#http request method: GET
https://api.weixin.qq.com/cgi-bin/customservice/getonlinekflist?access_token=ACCESS_TOKEN
##1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Return data example (JSON return result when correct):
{
"kf_online_list": [
"kf_account" {
"kf_account" ": "test1@test",
           "status": 1, 
           "kf_id""1001"
           "accepted_case": 1
       },
       {
           "kf_account""test2@test"
           "status": 1, 
           "kf_id""1002"
           "accepted_case": 2
       }
   ]
}

Parameter Description

ParametersDescription
kf_accountComplete customer service account, the format is: account prefix@public WeChat ID
statusCustomer service online status, currently: 1. web online
kf_idCustomer service number
accepted_caseThe number of sessions currently being received by customer service

Add customer service account

##Call instructions

Parameter Description

1
2
3
4
5
6
7
http request method: POST
https://api.weixin.qq.com/customservice/kfaccount/ add?access_token=ACCESS_TOKEN
POST data example is as follows:
{
"kf_account" : "test1@test",
"nickname" : "Customer Service 1"
}
参数说明
kf_account完整客服帐号,格式为:帐号前缀@公众号微信号,帐号前缀最多10个字符,必须是英文、数字字符或者下划线,后缀为公众号微信号,长度不超过30个字符
nickname客服昵称,最长16个字

Return description

Main return code

##1
2
3
4
5
Return data example (JSON return result when correct):
{
"errcode" : 0,
"errmsg" : "ok"
##}
Return codeDescription
0Success
65400API is not available, that is, the new customer service function has not been activated/upgraded
65403The customer service nickname is illegal
65404Customer service account is illegal
65405The number of accounts has reached the upper limit, and you cannot add any more
65406Existing customer service accounts

Invitation to bind customer service account

The newly added customer service account cannot be used directly. Only customer service staff can bind it with WeChat ID. After you have set up a customer service account, you can log in to the web customer service for operations. This interface initiates a binding invitation to the customer service staff's WeChat ID. The customer service staff needs to confirm with the WeChat ID on the WeChat client before the account can be used. Accounts that have not been bound to WeChat ID can be bound to the invitation operation. If the invitation has not expired, the account cannot be bound to WeChat ID to invite again.

Call instructions

1
2
3
4
5
6
7
##http request method: POST
https://api.weixin.qq.com/customservice/kfaccount/inviteworker?access_token=ACCESS_TOKEN
POST data examples are as follows:
{
"kf_account " : "test1@test",
"invite_wx" : "test_kfwx"
}

Parameter Description

参数说明
kf_account完整客服帐号,格式为:帐号前缀@公众号微信号
invite_wx接收绑定邀请的客服微信号

Return description

Main return code

##1
2
3
4
5
Return data example (JSON return result when correct):
{
"errcode" : 0,
"errmsg" : "ok"
##}
Return codeDescription
0Success
65400API is not available, that is, it has not been activated/upgraded to the new version of customer service
65401Invalid customer service account
65407The invitee is already the customer service of this official account
65408This public account has sent an invitation to this WeChat ID
65409Invalid WeChat ID
65410The number of invitees bound to official customer service accounts has reached the upper limit (currently each WeChat account can be bound to up to 5 official customer service accounts)
65411This account already has an invitation waiting for confirmation and cannot be invited again
65412This account has been bound to WeChat ID , cannot invite

Set customer service information

Call instructions

1
2
3
4
5
6
7
http request method: POST
https://api.weixin.qq.com/customservice/kfaccount/update?access_token =ACCESS_TOKEN
POST data example is as follows:
{
"kf_account" : "test1@test",
"nickname" : "Customer Service 1"
}

Parameter Description

参数说明
kf_account完整客服帐号,格式为:帐号前缀@公众号微信号
nickname客服昵称,最长16个字

Return description

1
2
3
4
5
Return data example (JSON return result when correct):
{
"errcode" : 0,
"errmsg" : "ok"
}

Main return code

Return codeDescription
0Success
65400API is not available, that is, the new version of customer service function has not been activated/upgraded
65401Invalid customer service account
65403Customer service nickname is illegal


##Upload customer service avatar

Call instructions

Parameter description

1
2
3
4
5
httpRequest method: POST/FORM
https://api.weixin.qq.com/customservice/kfaccount/uploadheadimg?access_token=ACCESS_TOKEN&kf_account= KFACCOUNT
Call example (use curl command to upload a multimedia file using FORM form):
curl - F media=@test.jpg "https://api.weixin.qq.com/customservice/kfaccount/uploadheadimg?access_token=ACCESS_TOKEN&kf_account=KFACCOUNT"
##ParameterDescription##kf_accountmedia


Return description 12345 Return data example (JSON return result when correct): { "errcode" : 0, "errmsg" : "ok" } Main return code Return code description 0 Success 65400 API is not available , that is, the customer service function has not been activated/upgraded to the new version 65401 Invalid customer service account 65403 Illegal customer service nickname 40005 Unsupported media type 40009 Illegal media file length Delete customer service account call instructions 12 http request method: GET https://api.weixin.qq. com/customservice/kfaccount/del?access_token=ACCESS_TOKEN&kf_account=KFACCOUNT Parameter description Parameter description kf_account complete customer service account, the format is: account prefix @ official account WeChat ID return description
Complete customer service account, the format is: account prefix@official account WeChat ID
form-data media file identification, including filename, filelength, content -type and other information, the file size is within 5M

Main return code

1
2
3
4
5
Return data example (when correct JSON return result):
{
##"errcode" : 0,
"errmsg" : "ok"
}
返回码

说明

0成功
65400API不可用,即没有开通/升级到新版客服功能
65401无效客服帐号


Customer Service Management Interface Return Code Description

Return codeDescription
0Success
65400API is not available, that is, the new version of customer service function has not been activated/upgraded
65401Invalid customer service account
65403Customer service nickname is illegal
65404The customer service account is illegal
65405The number of accounts has reached the upper limit and no more additions can be made
65406Existing customer service account
65407

The invitee is already the customer service account of the public account

65408

This public account already has an invitation to the WeChat

65409Invalid WeChat ID
65410The customer service number of the public account bound to the invitee The upper limit has been reached (currently each WeChat account can be bound to 5 official customer service accounts)
65411This account already has an invitation waiting for confirmation and cannot be invited again.
65412This account has been bound to WeChat ID and cannot be invited
40005No Supported media types
40009The media file length is illegal