Class: LinkedIn::Companies

Inherits:
APIResource show all
Defined in:
lib/linked_in/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

(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_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

Parameters:

  • company_id (String)

    Company ID

See Also:



96
97
98
99
100
# File 'lib/linked_in/companies.rb', line 96

def add_company_share(company_id, share)
  path = "/companies/#{company_id}/shares"
  defaults = {visibility: {code: "anyone"}}
  post(path, defaults.merge(share))
end

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

Retrieve a Company Profile

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :scope (String)
  • :type (String)
  • :count (String)
  • :start (String)

Returns:

See Also:



27
28
29
30
# File 'lib/linked_in/companies.rb', line 27

def company(options = {})
  path = company_path(options)
  get(path, options)
end

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

Retrieve statistics for a particular company page

Permissions: rw_company_admin



54
55
56
57
# File 'lib/linked_in/companies.rb', line 54

def company_statistics(options={})
  path = "#{company_path(options)}/company-statistics"
  get(path, options)
end

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

Retrieve a feed of event items for a Company

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :event-type (String)
  • :count (String)
  • :start (String)

Returns:

See Also:



41
42
43
44
# File 'lib/linked_in/companies.rb', line 41

def company_updates(options={})
  path = "#{company_path(options)}/updates"
  get(path, options)
end

#company_updates_comments(update_key, options = {}) ⇒ LinkedIn::Mash

Retrieve comments on a particular company update:

Parameters:

  • update_key (String)

    a update/update-key representing a particular company update

Returns:

See Also:



67
68
69
70
# File 'lib/linked_in/companies.rb', line 67

def company_updates_comments(update_key, options={})
  path = "#{company_path(options)}/updates/key=#{update_key}/update-comments"
  get(path, options)
end

#company_updates_likes(update_key, options = {}) ⇒ LinkedIn::Mash

Retrieve likes on a particular company update:

Parameters:

  • update_key (String)

    a update/update-key representing a particular company update

Returns:

See Also:



80
81
82
83
# File 'lib/linked_in/companies.rb', line 80

def company_updates_likes(update_key, options={})
  path = "#{company_path(options)}/updates/key=#{update_key}/likes"
  get(path, options)
end

#follow_company(company_id) ⇒ void

This method returns an undefined value.

(Create) authenticated user starts following a company

Parameters:

  • company_id (String)

    Company ID

See Also:



108
109
110
111
# File 'lib/linked_in/companies.rb', line 108

def follow_company(company_id)
  path = "/people/~/following/companies"
  post(path, {id: company_id})
end

#unfollow_company(company_id) ⇒ void

This method returns an undefined value.

(Destroy) authenticated user stops following a company

Parameters:

  • company_id (String)

    Company ID

See Also:



119
120
121
122
# File 'lib/linked_in/companies.rb', line 119

def unfollow_company(company_id)
  path = "/people/~/following/companies/id=#{company_id}"
  delete(path)
end