Module: LinkedIn::Api::Companies
- Included in:
- Client
- Defined in:
- lib/linked_in/api/companies.rb
Overview
Companies API
The following API actions do not have corresponding methods in this module
- Permissions Checking Endpoints for Company Shares
- GET Suggested Companies to Follow
- GET Company Products
Instance Method Summary collapse
-
#add_company_share(company_id, share) ⇒ void
Create a share for a company that the authenticated user administers.
-
#company(options = {}) ⇒ LinkedIn::Mash
Retrieve a Company Profile.
-
#company_statistics(options = {}) ⇒ LinkedIn::Mash
Retrieve statistics for a particular company page.
-
#company_updates(options = {}) ⇒ LinkedIn::Mash
Retrieve a feed of event items for a Company.
-
#company_updates_comments(update_key, options = {}) ⇒ LinkedIn::Mash
Retrieve comments on a particular company update:.
-
#company_updates_likes(update_key, options = {}) ⇒ LinkedIn::Mash
Retrieve likes on a particular company update:.
-
#follow_company(company_id) ⇒ void
(Create) authenticated user starts following a company.
-
#unfollow_company(company_id) ⇒ void
(Destroy) authenticated user stops following a company.
Instance Method Details
#add_company_share(company_id, share) ⇒ void
This method returns an undefined value.
Create a share for a company that the authenticated user administers
Permissions: rw_company_admin
99 100 101 102 103 |
# File 'lib/linked_in/api/companies.rb', line 99 def add_company_share(company_id, share) path = "/companies/#{company_id}/shares" defaults = { visibility: { code: 'anyone' } } post(path, MultiJson.dump(defaults.merge(share)), "Content-Type" => "application/json") end |
#company(options = {}) ⇒ LinkedIn::Mash
Retrieve a Company Profile
30 31 32 33 |
# File 'lib/linked_in/api/companies.rb', line 30 def company( = {}) path = company_path() simple_query(path, ) end |
#company_statistics(options = {}) ⇒ LinkedIn::Mash
Retrieve statistics for a particular company page
Permissions: rw_company_admin
57 58 59 60 |
# File 'lib/linked_in/api/companies.rb', line 57 def company_statistics(={}) path = "#{company_path()}/company-statistics" simple_query(path, ) end |
#company_updates(options = {}) ⇒ LinkedIn::Mash
Retrieve a feed of event items for a Company
44 45 46 47 |
# File 'lib/linked_in/api/companies.rb', line 44 def company_updates(={}) path = "#{company_path()}/updates" simple_query(path, ) end |
#company_updates_comments(update_key, options = {}) ⇒ LinkedIn::Mash
Retrieve comments on a particular company update:
70 71 72 73 |
# File 'lib/linked_in/api/companies.rb', line 70 def company_updates_comments(update_key, ={}) path = "#{company_path()}/updates/key=#{update_key}/update-comments" simple_query(path, ) end |
#company_updates_likes(update_key, options = {}) ⇒ LinkedIn::Mash
Retrieve likes on a particular company update:
83 84 85 86 |
# File 'lib/linked_in/api/companies.rb', line 83 def company_updates_likes(update_key, ={}) path = "#{company_path()}/updates/key=#{update_key}/likes" simple_query(path, ) end |
#follow_company(company_id) ⇒ void
This method returns an undefined value.
(Create) authenticated user starts following a company
111 112 113 114 115 |
# File 'lib/linked_in/api/companies.rb', line 111 def follow_company(company_id) path = "/people/~/following/companies" body = { id: company_id } post(path, MultiJson.dump(body), "Content-Type" => "application/json") end |
#unfollow_company(company_id) ⇒ void
This method returns an undefined value.
(Destroy) authenticated user stops following a company
123 124 125 126 |
# File 'lib/linked_in/api/companies.rb', line 123 def unfollow_company(company_id) path = "/people/~/following/companies/id=#{company_id}" delete(path) end |