mingyoung / dingtalk

[已停止维护]
MIT License
562 stars 115 forks source link

根据手机号获取用户信息接口参数名错误 #63

Closed dapeng186 closed 4 years ago

dapeng186 commented 4 years ago

代码文件路径:vendor\mingyoung\dingtalk\src\User\Client.php

代码块:

 /**
     * 根据员工手机号获取 Userid
     *
     * @param string $phone
     *
     * @return mixed
     */
    public function getUserIdByPhone($phone = '')
    {
        return $this->client->get('user/get_by_mobile', compact('phone'));
    }

这里的 phone 参数名官方实际为 mobile ,使用 phone 参数名接口报错


官方接口说明

请求方式:GET(HTTPS)

请求地址:https://oapi.dingtalk.com/user/get_by_mobile?access_token=ACCESS_TOKEN&mobile=1xxxxxxxxxx

名称 类型 是否必须 说明
access_token String 必须 调用接口凭证,通过获取企业access_token获取
mobile String 必须 手机号码

参考资料-钉钉官方手册