微信小程序 getPhoneNumber 获取手机号接口

猪宝儿/ 2023年11月20日/ 小程序/ 浏览 805

getPhoneNumber该接口用于将code换取用户手机号。 说明,每个code只能使用一次,code的有效期为5min。


http调用 POST: https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=ACCESS_TOKEN


云调用:

出入参和HTTPS调用相同,调用方式可查看云调用说明文档


接口方法为: openapi.phonenumber.getPhoneNumber


第三方调用:

调用方式以及出入参和HTTPS相同,仅是调用的token不同


该接口所属的权限集id为:18


服务商获得其中之一权限集授权后,可通过使用authorizer_access_token代商家进行调用


请求数据示例


{
"code": "e31968a7f94cc5ee25fafc2aef2773f0bb8c3937b22520eb8ee345274d00c144"
} 


返回数据示例


{
    "errcode":0,
    "errmsg":"ok",
    "phone_info": {
        "phoneNumber":"xxxxxx",
        "purePhoneNumber": "xxxxxx",
        "countryCode": 86,
        "watermark": {
            "timestamp": 1637744274,
            "appid": "xxxx"
        }
    }
} 


详细介绍:https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/user-info/phone-number/getPhoneNumber.html

发表评论

暂无评论,抢个沙发...

客服 工单