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

(contribute here)

Instance Method Summary collapse

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:



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

Parameters:

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

    identifies the user profile you want

Options Hash (options):

  • :domain (String)

    company email domain

  • :id (String)

    company ID

  • :url (String)
  • :name (String)

    company universal name

  • :is_admin (String)

    list all companies that the authenticated is an administrator of

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

Returns:

See Also:



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

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

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

Retrieve statistics for a particular company page

Permissions: rw_company_admin

Parameters:

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

    identifies the user profile you want

Options Hash (options):

  • :domain (String)

    company email domain

  • :id (String)

    company ID

  • :url (String)
  • :name (String)

    company universal name

  • :is_admin (String)

    list all companies that the authenticated is an administrator of

Returns:

See Also:



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

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

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

Retrieve a feed of event items for a Company

Parameters:

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

    identifies the user profile you want

Options Hash (options):

  • :domain (String)

    company email domain

  • :id (String)

    company ID

  • :url (String)
  • :name (String)

    company universal name

  • :is_admin (String)

    list all companies that the authenticated is an administrator of

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

Returns:

See Also:



44
45
46
47
# File 'lib/linked_in/api/companies.rb', line 44

def company_updates(options={})
  path = "#{company_path(options)}/updates"
  simple_query(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

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

    identifies the user profile you want

Options Hash (options):

  • :domain (String)

    company email domain

  • :id (String)

    company ID

  • :url (String)
  • :name (String)

    company universal name

  • :is_admin (String)

    list all companies that the authenticated is an administrator of

Returns:

See Also:



70
71
72
73
# File 'lib/linked_in/api/companies.rb', line 70

def company_updates_comments(update_key, options={})
  path = "#{company_path(options)}/updates/key=#{update_key}/update-comments"
  simple_query(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

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

    identifies the user profile you want

Options Hash (options):

  • :domain (String)

    company email domain

  • :id (String)

    company ID

  • :url (String)
  • :name (String)

    company universal name

  • :is_admin (String)

    list all companies that the authenticated is an administrator of

Returns:

See Also:



83
84
85
86
# File 'lib/linked_in/api/companies.rb', line 83

def company_updates_likes(update_key, options={})
  path = "#{company_path(options)}/updates/key=#{update_key}/likes"
  simple_query(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:



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

Parameters:

  • company_id (String)

    Company ID

See Also:



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