企业微信api接口调用-通过手机号或微信好友添加客户

简介: 企业微信api接口调用-通过手机号或微信好友添加客户

企业微信SDK接口API调用-通过手机号或微信好友添加客户

/**
* 企业微信搜索手机号添加微信
* @author wechat:happybabby110
* @blog http://www.wlkankan.cn
*/
public  void handleMsg(ChannelHandlerContext ctx ,TransportMessage vo, String contentJsonStr) {
    try {
        log.debug(contentJsonStr);
        AddCustomerFromSearchTaskMessage.Builder bd = AddCustomerFromSearchTaskMessage.newBuilder();
        JsonFormat.parser().merge(contentJsonStr, bd);
        AddCustomerFromSearchTaskMessage req = bd.build();
    
        // 将消息转发送给手机客户端
        asyncTaskService.msgSend2Phone(ctx, String.valueOf(req.getWxId()), EnumMsgType.AddCustomerFromSearchTask, vo, req);
 
    } catch (Exception e) {
        e.printStackTrace();
        MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InvalidParam, Constant.ERROR_MSG_DECODFAIL);
    }
}
 
 
/** 
 * 从企业微信好友中添加客户
 * @author wechat:happybabby110
 * @blog http://www.wlkankan.cn
 */
public  void handleMsg(ChannelHandlerContext ctx ,TransportMessage vo, String contentJsonStr) {
    try {
        log.debug(contentJsonStr);
        AddCustomerFromWxTaskMessage.Builder bd = AddCustomerFromWxTaskMessage.newBuilder();
        JsonFormat.parser().merge(contentJsonStr, bd);
        AddCustomerFromWxTaskMessage req = bd.build();
    
        // 将消息转发送给手机客户端
        asyncTaskService.msgSend2Phone(ctx, String.valueOf(req.getWxId()), EnumMsgType.AddCustomerFromWxTask, vo, req);
 
    } catch (Exception e) {
        e.printStackTrace();
        MessageUtil.sendJsonErrMsg(ctx, EnumErrorCode.InvalidParam, Constant.ERROR_MSG_DECODFAIL);
    }
}


相关文章
|
10天前
|
存储 小程序 前端开发
【微信小程序 - 工作实战分享】1.微信小程序发送手机短信验证码(阿里云)
【微信小程序 - 工作实战分享】1.微信小程序发送手机短信验证码(阿里云)
17 0
|
5天前
|
小程序 API
微信小程序getLocation报错 getLocation:fail the api need to be declared in the requiredPrivateInfos field in
微信小程序getLocation报错 getLocation:fail the api need to be declared in the requiredPrivateInfos field in
5 1
|
11天前
|
API
个人微信api接口源代码
个人微信api接口源代码
|
3天前
|
前端开发 小程序
【微信小程序-原生开发】实用教程20 - 生成海报(实战范例为生成活动海报,内含生成指定页面的小程序二维码,保存图片到手机,canvas 系列教程)
【微信小程序-原生开发】实用教程20 - 生成海报(实战范例为生成活动海报,内含生成指定页面的小程序二维码,保存图片到手机,canvas 系列教程)
6 0
|
3天前
|
前端开发 小程序 API
【微信小程序】使用 Promise、async 和 await 将异步API 改写为同步
【微信小程序】使用 Promise、async 和 await 将异步API 改写为同步
14 0
|
3天前
|
小程序 JavaScript 安全
【微信小程序-原生开发】转发给好友/群,分享到朋友圈(含单页模式访问云开发数据库的方法)
【微信小程序-原生开发】转发给好友/群,分享到朋友圈(含单页模式访问云开发数据库的方法)
8 0
|
3天前
|
小程序 数据库 C++
【微信小程序-原生开发】实用教程17 - 详情页触发列表页刷新,点击图片放大预览,转发给好友/群,分享到朋友圈
【微信小程序-原生开发】实用教程17 - 详情页触发列表页刷新,点击图片放大预览,转发给好友/群,分享到朋友圈
8 0
|
10天前
|
API 开发工具
企业微信SDK接口API调用-通过手机号或微信好友添加客户
企业微信SDK接口API调用-通过手机号或微信好友添加客户
|
10天前
|
API 开发工具
企业微信SDK接口API调用-触发推送企业微信微信好友
企业微信SDK接口API调用-触发推送企业微信微信好友
|
10天前
微信小游戏全局开启好友和朋友圈分享功能
微信小游戏全局开启好友和朋友圈分享功能
10 0