Class: LinkedIn::Groups

Inherits:
APIResource show all
Defined in:
lib/linked_in/groups.rb

Overview

Groups API

The following API actions do not have corresponding methods in this module

  • PUT Change my Group Settings
  • POST Change my Group Settings
  • DELETE Leave a group
  • PUT Follow/unfollow a Group post
  • PUT Flag a Post as a Promotion or Job
  • DELETE Delete a Post
  • DELETE Flag a post as inappropriate
  • DELETE A comment or flag comment as inappropriate
  • DELETE Remove a Group Suggestion

(contribute here)

Instance Method Summary collapse

Methods inherited from APIResource

#initialize

Constructor Details

This class inherits a constructor from LinkedIn::APIResource

Instance Method Details

#add_group_share(group_id, share) ⇒ void

This method returns an undefined value.

Create a share for a company that the authenticated user administers

Permissions: rw_groups

Parameters:

  • group_id (String)

    Group ID

See Also:



88
89
90
91
# File 'lib/linked_in/groups.rb', line 88

def add_group_share(group_id, share)
  path = "/groups/#{group_id}/posts"
  post(path, share)
end

#group_memberships(options = {}) ⇒ LinkedIn::Mash

Retrieve the groups a current user belongs to

Permissions: rw_groups



43
44
45
46
# File 'lib/linked_in/groups.rb', line 43

def group_memberships(options = {})
  path = "#{profile_path(options)}/group-memberships"
  get(path, options)
end

#group_posts(options) ⇒ LinkedIn::Mash

Retrieve the posts in a group

Permissions: rw_groups

Parameters:

  • options (Hash)

    identifies the group or groups

Returns:

See Also:



73
74
75
76
# File 'lib/linked_in/groups.rb', line 73

def group_posts(options)
  path = "#{group_path(options)}/posts"
  get(path, options)
end

#group_profile(options) ⇒ LinkedIn::Mash

Retrieve the profile of a group

Permissions: rw_groups

Parameters:

  • options (Hash)

    identifies the group or groups

Returns:

See Also:



57
58
59
60
# File 'lib/linked_in/groups.rb', line 57

def group_profile(options)
  path = group_path(options)
  get(path, options)
end

#group_suggestions(options = {}) ⇒ LinkedIn::Mash

Retrieve group suggestions for the current user

Permissions: r_fullprofile



30
31
32
33
# File 'lib/linked_in/groups.rb', line 30

def group_suggestions(options = {})
  path = "#{profile_path(options)}/suggestions/groups"
  get(path, options)
end

#join_group(group_id) ⇒ void

This method returns an undefined value.

(Update) User joins, or requests to join, a group

Parameters:

  • group_id (String)

    Group ID

See Also:



99
100
101
102
103
# File 'lib/linked_in/groups.rb', line 99

def join_group(group_id)
  path = "/people/~/group-memberships/#{group_id}"
  body = {'membership-state' => {'code' => 'member' }}
  put(path, body)
end