Module: LinkedIn::Api::Groups

Included in:
Client
Defined in:
lib/linked_in/api/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

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:



97
98
99
100
# File 'lib/linked_in/api/groups.rb', line 97

def add_group_share(group_id, share)
  path = "/groups/#{group_id}/posts"
  post(path, MultiJson.dump(share), "Content-Type" => "application/json")
end

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

Retrieve the groups a current user belongs to

Permissions: rw_groups

Parameters:

  • options (Hash) (defaults to: {})

    identifies the user profile you want

Options Hash (options):

  • :id (String)

    a member token

  • :url (String)

    a Public Profile URL

  • :email (String)

Returns:

See Also:



46
47
48
49
# File 'lib/linked_in/api/groups.rb', line 46

def group_memberships(options = {})
  path = "#{person_path(options)}/group-memberships"
  simple_query(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:



76
77
78
79
# File 'lib/linked_in/api/groups.rb', line 76

def group_posts(options)
  path = "#{group_path(options)}/posts"
  simple_query(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:



60
61
62
63
# File 'lib/linked_in/api/groups.rb', line 60

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

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

Retrieve group suggestions for the current user

Permissions: r_fullprofile

Parameters:

  • options (Hash) (defaults to: {})

    identifies the user profile you want

Options Hash (options):

  • :id (String)

    a member token

  • :url (String)

    a Public Profile URL

  • :email (String)

Returns:

See Also:



33
34
35
36
# File 'lib/linked_in/api/groups.rb', line 33

def group_suggestions(options = {})
  path = "#{person_path(options)}/suggestions/groups"
  simple_query(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:



108
109
110
111
112
# File 'lib/linked_in/api/groups.rb', line 108

def join_group(group_id)
  path = "/people/~/group-memberships/#{group_id}"
  body = {'membership-state' => {'code' => 'member' }}
  put(path, MultiJson.dump(body), "Content-Type" => "application/json")
end

#post_group_discussion(group_id, discussion) ⇒ Object

Deprecated.

Use #add_group_share instead



82
83
84
85
# File 'lib/linked_in/api/groups.rb', line 82

def post_group_discussion(group_id, discussion)
  warn 'Use add_group_share over post_group_discussion. This will be taken out in future versions'
  add_group_share(group_id, discussion)
end