user216084
user216084

Reputation:

LinkedIn Groups API - Getting group logo for multiple groups in a single API request

Using LinkedIn Groups API, I am showing a list of groups the user is a member of on LinkedIn. Getting the list of groups in a single call is clear using

https://api.linkedin.com/v1/people/~/group-memberships:(group:(id,name),membership-state)?count=50&start=0&oauth2_access_token=' . $accessKey;

Task

Now, I want to show the group logo image alongside the group name. However, this would mean for n groups, I have to do n more API calls, and this slows down the page load (e.g. for 50 groups).

The documentation states,

You can access details about one or more groups such as the ID, name, settings, and posts from any groups resource path.

https://api.linkedin.com/v1/groups/{group-id}:(id,name,short-description,description,relation-to-viewer:(membership-state,available-actions),posts,counts-by-category,is-open-to-non-members,category,website-url,locale,location:(country,postal-code),allow-member-invites,site-group-url,small-logo-url,large-logo-url)

I want to get the logo images of the mentioned group ids in a single API call.

What I have tried

Kindly guide what I am missing here, as the documentation also suggests one or more groups and it is a genuine use-case.

Upvotes: 1

Views: 1020

Answers (1)

C3roe
C3roe

Reputation: 96417

https://api.linkedin.com/v1/people/~/group-memberships:(group:(id,name),…

You should be able to ask for all additional group fields you want directly in this call, by extending the field list after group:(… accordingly:

https://api.linkedin.com/v1/people/~/group-memberships:(group:(id,name,
small-lo‌​go-url,large-logo-url),…

Upvotes: 1

Related Questions