ThinkSSL🔒 一键申购 5分钟快速签发 30天无理由退款 购买更放心 广告
>[danger] **[点此进入芝麻小客服官网](https://xiaokefu.com.cn/?source=kanyun_mia_2376866)** <br> # 在小程序中使用微信客服 <br> <br> 对接前提:微信客服的企业ID,与小程序的主体需要保持一致。 </h> ![](https://img.kancloud.cn/78/c7/78c732c821836d2c615608452fb0f015_1821x838.png) </h> 1、获取微信客服地址。登录芝麻客服后台,选择对应的微信客服企业,选择渠道设置。点击渠道链接的复制即可。 ![](https://img.kancloud.cn/98/81/9881d5cb9ed73f71f5ac48e4e602e6df_1747x615.png) 2、在小程序中调用官方API([API地址](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/service-chat/wx.openCustomerServiceChat.html)),打开微信客服。示例如下: ~~~ wx.openCustomerServiceChat({ extInfo: {url: 'https://work.weixin.qq.com/kfid/kfc3e76250fea3df696?encScene=ENC9GcAL6Rv9o1ttdmK99HPNQP3RJMufX6aXFukCnceDVX1'}, corpId: 'ww6a828cef76872a2d', success(res) {} } ) ~~~ 其中,url为1中获取的渠道链接,corpID为微信客服后台获取的企业id: ![](https://img.kancloud.cn/fe/da/feda367c80dfda0a478bd48125109711_1398x636.png) 3、用户点击按钮,即可跳转到微信客服界面咨询客服了。 ![](https://img.kancloud.cn/e8/9b/e89b88893bc4c442591feb2e318a08f9_328x376.gif) </h> </h> <br> <br> <br> >[danger] **[点此进入芝麻小客服官网](https://xiaokefu.com.cn/?source=kanyun_mia_2376866)** <br> 您有问题需要咨询的话,可以扫描下方二维码: </h> ![](https://img.kancloud.cn/04/a1/04a1fd65b5f5cfbc32ad431a32fabd2a_200x199.png) </h> </h>