private static final String host = "api.linkedin.com";
private static final String PROTECTED_URL_GET_CURRENT_USER_PROFILE = "https://api.linkedin.com/v1/people/~:(id,first-name,last-name,email-address,picture-url,industry)";
如何添加字段以获取联系号码?
还有其他方法可以从Linked-in获取详细信息吗?
答案 0 :(得分:1)
使用以下网址获取LinkedIn数据。
private static final String HOST = "api.linkedin.com";
private static final String FETCH_BASIC_INFO = "https://" + host + "/v1/people/~:(id,first-name,last-name,headline,location,industry)";
private static final String FETCH_CONTACT = "https://" + host + "/v1/people/~:(num-connections,email-address,phone-numbers,main-address)";
private static final String FETCH_PROFILE_PIC = "https://" + host + "/v1/people/~:(picture-urls::(original))";
private static final String SHARE_URL = "https://" + host + "/v1/people/~/shares";
不要忘记在移动应用中以及在LinkedIn中注册应用时设置访问上述信息的权限
private static Scope buildScope() {
return Scope.build(Scope.R_BASICPROFILE, Scope.W_SHARE, Scope.R_EMAILADDRESS, Scope.R_CONTACTINFO);
}