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
Instance Method Summary collapse
-
#add_group_share(group_id, share) ⇒ void
Create a share for a company that the authenticated user administers.
-
#group_memberships(options = {}) ⇒ LinkedIn::Mash
Retrieve the groups a current user belongs to.
-
#group_posts(options) ⇒ LinkedIn::Mash
Retrieve the posts in a group.
-
#group_profile(options) ⇒ LinkedIn::Mash
Retrieve the profile of a group.
-
#group_suggestions(options = {}) ⇒ LinkedIn::Mash
Retrieve group suggestions for the current user.
-
#join_group(group_id) ⇒ void
(Update) User joins, or requests to join, a group.
-
#post_group_discussion(group_id, discussion) ⇒ Object
deprecated
Deprecated.
Use #add_group_share instead
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
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
46 47 48 49 |
# File 'lib/linked_in/api/groups.rb', line 46 def group_memberships( = {}) path = "#{person_path()}/group-memberships" simple_query(path, ) end |
#group_posts(options) ⇒ LinkedIn::Mash
Retrieve the posts in a group
Permissions: rw_groups
76 77 78 79 |
# File 'lib/linked_in/api/groups.rb', line 76 def group_posts() path = "#{group_path()}/posts" simple_query(path, ) end |
#group_profile(options) ⇒ LinkedIn::Mash
Retrieve the profile of a group
Permissions: rw_groups
60 61 62 63 |
# File 'lib/linked_in/api/groups.rb', line 60 def group_profile() path = group_path() simple_query(path, ) end |
#group_suggestions(options = {}) ⇒ LinkedIn::Mash
Retrieve group suggestions for the current user
Permissions: r_fullprofile
33 34 35 36 |
# File 'lib/linked_in/api/groups.rb', line 33 def group_suggestions( = {}) path = "#{person_path()}/suggestions/groups" simple_query(path, ) end |
#join_group(group_id) ⇒ void
This method returns an undefined value.
(Update) User joins, or requests to join, a group
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
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 |