关键代码:
JAVA代码
/**
* 获取用户个人信息
*
* @param accessToken
* @return
* @throws Exception
*/
public String getUserinfo(String accessToken) throws Exception {
com.aliyun.dingtalkcontact_1_0.Client client = contactClient();
GetUserHeaders getUserHeaders = new GetUserHeaders();
getUserHeaders.xAcsDingtalkAccessToken = accessToken;
//获取用户个人信息,如需获取当前授权人的信息,unionId参数必须传me
String me = JSON.toJSONString(client.getUserWithOptions("me", getUserHeaders, new RuntimeOptions()).getBody());
System.out.println(me);
return me;
}
我的依赖POM版本号:
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>dingtalk</artifactId>
<version>2.0.67</version>
<scope>compile</scope>
</dependency>
我遇见的错误:
我的权限申请情况: