微信开发之一键获取好友详情的技术实现

简要描述:

  • 获取联系人信息

请求URL:

  • http://域名地址/getContact

请求方式:

  • POST

请求头Headers:

  • Content-Type:application/json
  • Authorization:login接口返回

参数:

参数名必选类型说明
wIdString登录实例标识
wcIdString好友微信id/群id,多个好友/群 以","分隔每次最多支持20个微信/群号,记得本接口随机间隔300ms-1500ms,频繁调用容易导致掉线

请求参数示例

<span style="color:#333333"><span style="background-color:#ffffff"><span style="background-color:#f7f8f9"><span style="color:black"><code>
<span style="color:#999999">{</span>
    <span style="color:#990055">"wId"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"349be9b5-8734-45ce-811d-4e10ca568c67"</span><span style="color:#999999">,</span>
    <span style="color:#990055">"wcId"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"LoChaX,wxid_wl9qchkanp9u22"</span>
<span style="color:#999999">}</span></code></span></span></span></span>

成功返回示例

<span style="color:#333333"><span style="background-color:#ffffff"><span style="background-color:#f7f8f9"><span style="color:black"><code><span style="color:#999999">{</span>
    <span style="color:#990055">"message"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"成功"</span><span style="color:#999999">,</span>
    <span style="color:#990055">"code"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"1000"</span><span style="color:#999999">,</span>
    <span style="color:#990055">"data"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#999999">[</span>
        <span style="color:#999999">{</span>
            <span style="color:#990055">"userName"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"test558666"</span><span style="color:#999999">,</span>
            <span style="color:#990055">"nickName"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"追风少年666"</span><span style="color:#999999">,</span>
            <span style="color:#990055">"remark"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">""</span><span style="color:#999999">,</span>
            <span style="color:#990055">"signature"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"66666"</span><span style="color:#999999">,</span>
            <span style="color:#990055">"sex"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#990055">1</span><span style="color:#999999">,</span>
            <span style="color:#990055">"aliasName"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"test558666"</span><span style="color:#999999">,</span>
            <span style="color:#990055">"country"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"CN"</span><span style="color:#999999">,</span>
            <span style="color:#990055">"bigHead"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"http://wx.qlogo.cn/mmhead/PiajxSqBRaEL8iaRQBnStn37LYat3fREC4Y2iaStECzbX3icxntWBhWQ3w/0"</span><span style="color:#999999">,</span>
            <span style="color:#990055">"smallHead"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"http://wx.qlogo.cn/mmhead/PiajxSqBRaEL8iaRQBnStn37LYat3fREC4Y2iaStECzbX3icxntWBhWQ3w/132"</span><span style="color:#999999">,</span>
            <span style="color:#990055">"labelList"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">""</span><span style="color:#999999">,</span>
            <span style="color:#990055">"v1"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"v1_584e7774024c79af0e7304bf7afba775b31bf075651c16c964b1b5bf16369924ebf1ee7bc151c1feee1979e1dd40f0dd@stranger"</span>
        <span style="color:#999999">}</span>
    <span style="color:#999999">]</span>
<span style="color:#999999">}</span></code></span></span></span></span>

错误返回示例

<span style="color:#333333"><span style="background-color:#ffffff"><span style="background-color:#f7f8f9"><span style="color:black"><code><span style="color:#999999">{</span>
    <span style="color:#990055">"message"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"失败"</span><span style="color:#999999">,</span>
    <span style="color:#990055">"code"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"1001"</span><span style="color:#999999">,</span>
    <span style="color:#990055">"data"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#0077aa">null</span>
<span style="color:#999999">}</span></code></span></span></span></span>

返回数据:

参数名类型说明
codeString1000成功
1001失败
msgString反馈信息
dataJSONObject
userNameString微信id
nickNameString昵称
remarkString备注
signatureString签名
sexint性别
aliasNameString微信号
countryString国家
bigHeadString大头像
smallHeadString小头像
labelListString标签列表
v1String用户的wxId,都是以v1开头的一串数值,v2数据,则是作为v1数据的辅助

测试地址:https://wkteam.cn/

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值