简体   繁体   中英

How to search people in Linkedin by company name

I've this simple code

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;
}

And this error:

 Exception in thread "main" com.google.code.linkedinapi.client.LinkedInApiClientException: Access to people search denied.

I don't know why I can't search people on LinkedIn by company name, (ie is Facebook). I've set the app in Developer section of Linkedin with all read and write permission.

I'm using linkedin-j for doing all this.

Someone can help me?

Thanks a lot for your time :)

我认为他们正在关闭对API的公开访问

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM