-1

HI i wanted to get entire group list from linkedin using linkedin api,if not possible atleast get some groups from linkedin to process the data.can any one help how to get group list?

user1585111
  • 1,019
  • 6
  • 19
  • 35
  • Have you tried anything yet? If yes, then could you add the code you have tried? – jsalonen Aug 06 '13 at 17:50
  • Thanks for your qucik response,i have been using scribe 1.3.jar to get some of my basic operations done.i have hard coded the group value and then pass it to my method to get data of that particular group.now i have to get group list,get it iterated and pass each group number to my method and then get the data. – user1585111 Aug 06 '13 at 17:58
  • String resource1 = api.getResource(Urls.getGroupPostsUrl(groupId, 0));i would get the reponse as json string using the line which contains the group information – user1585111 Aug 06 '13 at 18:01
  • Look here http://stackoverflow.com/questions/21901268/linkedin-groups-api-getting-group-logo-for-multiple-groups-in-a-single-api-req – Vasiliy vvscode Vanchuk May 29 '15 at 11:29

1 Answers1

0

You can get groups using following code:

  final LinkedInApiClientFactory factory =  LinkedInApiClientFactory.newInstance(consumerKey, consumerSecKey);
    final LinkedInApiClient client = factory.createLinkedInApiClient(token, tokenSecret);

        GroupMemberships memberships = client.getGroupMemberships();
        for (GroupMembership membership : memberships.getGroupMembershipList()) {
            System.out.println(membership.getGroup().getName());
            System.out.println(membership.getGroup().getId());
            System.out.println(membership.getMembershipState().getCode());
        }
V_K
  • 226
  • 1
  • 10