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:



98
99
100
101
102
# File 'lib/linked_in/api/companies.rb', line 98

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:



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

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:



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

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:



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

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:



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

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:



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

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:



110
111
112
113
114
# File 'lib/linked_in/api/companies.rb', line 110

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:



122
123
124
125
# File 'lib/linked_in/api/companies.rb', line 122

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