0

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, (i.e. 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 :)

Fabio
  • 159
  • 1
  • 4
  • 13
  • 1
    Not sure if related, but, Linkedin is, essentially, shutting down open acess to it's API:[Changes to our Developer Program](https://developer.linkedin.com/blog/posts/2015/developer-program-changes) – Marko Živanović Mar 01 '15 at 20:14
  • @MarkoŽivanović from 12 May 2015, not now – Fabio Mar 02 '15 at 09:08

1 Answers1

0

I think they are shutting down open acess to API

Fabio
  • 159
  • 1
  • 4
  • 13