我有这个简单的代码
private static Map<SearchParameter, String> searchParameters = new HashMap<SearchParameter, String>();
//get data with LinkedIn API
public static void main(String args[]) throws InterruptedException, SQLException, MalformedURLException, IOException {
PeopleApiClient linkedin = authentication();
searchParameters.put(SearchParameter.COMPANY_NAME, "Facebook");
System.out.println(searchParameters);
People people = linkedin.searchPeople(searchParameters);
System.out.println(people);
}
//LinkedIn authentication
private static PeopleApiClient authentication() {
// The factory instance is re-usable and thread safe.
final LinkedInApiClientFactory factory = LinkedInApiClientFactory.newInstance(CONSUMER_KEY_VALUE, CONSUMER_SECRET_VALUE);
final PeopleApiClient linkedin = factory.createPeopleApiClient(ACCESS_TOKEN_VALUE, TOKEN_SECRET_VALUE);
return linkedin;
}
这个错误:
Exception in thread "main" com.google.code.linkedinapi.client.LinkedInApiClientException: Access to people search denied.
我不知道为什么我无法通过公司名称搜索LinkedIn上的人(即Facebook)。我已经在Linkedin的开发者部分设置了所有读写权限的应用程序。
我使用linkedin-j来做这一切。
有人可以帮助我吗?
非常感谢您的时间:)
答案 0 :(得分:0)
我认为他们正在关闭对API的开放访问