欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

钉钉 根据手机号码获取userId OapiUserGetByMobileRequest导包 java

程序员文章站 2024-03-20 17:36:34
...

1.在SDK的基础上下载jar包

2.


		<dependency>
			<groupId>com.taobao.top</groupId>
			<artifactId>top-api-sdk-dev</artifactId>
			<version>ding-open-mc-SNAPSHOT</version>
			<scope>system</scope>
			<systemPath>${pom.basedir}/lib/taobao-sdk-java-auto_1479188381469-20201222.jar</systemPath>
		</dependency>

3.

public class Main {
	public static void main(String[] args) {
		try {
			DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/user/get_by_mobile");
			OapiUserGetByMobileRequest req = new OapiUserGetByMobileRequest();
			req.setHttpMethod("GET");
			OapiUserGetByMobileResponse rsp = client.execute(req, access_token);
			System.out.println(rsp.getBody());
		} catch (ApiException e) {
			e.printStackTrace();
		}
	}
}

 

相关标签: 钉钉 java