Igor Savinkin
Igor Savinkin

Reputation: 6277

Linkedin Api: Get Groups I am a Member Of

I want to get all the groups I'm memeber of the linkedin API. I use JavaScript SDK for this:

<head> 
<script type="text/javascript" src="//platform.linkedin.com/in.js">
  api_key:   77iju32v9t2i18
  onLoad:    onLinkedInLoad
  authorize: true   
</script> 
<script type="text/javascript">     
// Setup an event listener to make an API call once auth is complete
function onLinkedInLoad() { 
    IN.Event.on(IN, "auth", getGroupsData);
}  
function onSuccessGroup(data) {
    console.log(data);
} 
function onError(error) {
    console.dir(error);     
}

// Use the API call wrapper to request the member's basic profile data
function getProfileData() {
    IN.API.Raw("/people/~").result(onSuccess).error(onError);
}
function getGroupsData() {
    IN.API.Raw("/people/~/group-memberships:(group:(id,name))?membership-state=member").result(onSuccessGroup).error(onError);
}

In the last function getGroupsData() I queried the url: "/people/~/group-memberships:(group:(id,name))?membership-state=member" from here but it issued the error:

XHR finished loading: GET "https://api.linkedin.com/v1/people/~/group-memberships:(group:(id,name))?membership-state=member"

errorCode: 0 message: "Access to group-memberships denied" requestId: "BEVJ2X6T7J" status: 403 timestamp: 1434439902873 __proto__: Object

What's missing, how to configure request group url?

Upvotes: 1

Views: 1316

Answers (1)

almudenari
almudenari

Reputation: 11

According to the new developer program

If your application is currently using any other API services (e.g. Connections, Groups, People Search, Invitation, Job Search, etc.) you will have to apply to become a member of a relevant Partner Program that provides the necessary API access to continue to leverage any of the endpoints that are not listed above.

More info: https://developer.linkedin.com/support/developer-program-transition#troubleshooting

Upvotes: 1

Related Questions