使用钉钉根据用户手机号查询信息接口 /v2/user/getbymobile
public class Main {
public static void main(String[] args) {
try {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/getbymobile");
OapiV2UserGetbymobileRequest req = new OapiV2UserGetbymobileRequest();
req.setMobile("15011112222");
OapiV2UserGetbymobileResponse rsp = client.execute(req, "xasdddddasdasd");
System.out.println(rsp.getBody());
} catch (ApiException e) {
e.printStackTrace();
}
}
}
解决方案 引入依赖
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>alibaba-dingtalk-service-sdk</artifactId>
<version>2.0.0</version>
</dependency>
依赖来源
阿里nexus