我如何从 LinkedIn API 获取电子邮件地址
How do I get an email address from the LinkedIn API
我已经启用了访问用户电子邮件地址的权限。
Permission to access email address
我试过更改我的电子邮件地址和隐私设置。
我肯定在请求正确的字段,因为没有发现错误并且返回了除电子邮件地址以外的所有字段。
String url = "https://api.linkedin.com/v1/people/~:(id,first-name,last-name,picture-urls::(original),industry,positions,email-address)";
JSON result returned
但它们都不起作用。可能是什么原因?
犯了一个愚蠢的错误。
原来我忘了在代码中设置访问电子邮件地址的权限。
// Build the list of member permissions our LinkedIn session requires
private static Scope buildScope() {
return Scope.build(Scope.R_BASICPROFILE);
}
更改为:
// Build the list of member permissions our LinkedIn session requires
private static Scope buildScope() {
return Scope.build(Scope.R_BASICPROFILE, Scope.R_EMAILADDRESS);
}
我已经启用了访问用户电子邮件地址的权限。
Permission to access email address
我试过更改我的电子邮件地址和隐私设置。
我肯定在请求正确的字段,因为没有发现错误并且返回了除电子邮件地址以外的所有字段。
String url = "https://api.linkedin.com/v1/people/~:(id,first-name,last-name,picture-urls::(original),industry,positions,email-address)";
JSON result returned
但它们都不起作用。可能是什么原因?
犯了一个愚蠢的错误。
原来我忘了在代码中设置访问电子邮件地址的权限。
// Build the list of member permissions our LinkedIn session requires
private static Scope buildScope() {
return Scope.build(Scope.R_BASICPROFILE);
}
更改为:
// Build the list of member permissions our LinkedIn session requires
private static Scope buildScope() {
return Scope.build(Scope.R_BASICPROFILE, Scope.R_EMAILADDRESS);
}