Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Company Rest API documentation links updated #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ api.join_group(12345)

Detailed overviews of Company information

See https://developer.linkedin.com/documents/companies
See https://developer.linkedin.com/docs/company-pages

```ruby
# Company info
Expand Down
32 changes: 15 additions & 17 deletions lib/linked_in/companies.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module LinkedIn
# Companies API
#
# @see http://developer.linkedin.com/documents/companies Companies API
# @see http://developer.linkedin.com/documents/company-lookup-api-and-fields Company Fields
# @see https://developer.linkedin.com/docs/company-pages Companies API
# @see https://developer.linkedin.com/docs/fields/company-profile Company Fields
#
# The following API actions do not have corresponding methods in
# this module
Expand All @@ -16,8 +16,9 @@ class Companies < APIResource

# Retrieve a Company Profile
#
# @see http://developer.linkedin.com/documents/company-lookup-api-and-fields
#
# @see https://developer.linkedin.com/docs/company-pages#company_profile
# @see https://developer.linkedin.com/docs/fields/company-profile
#
# @macro company_path_options
# @option options [String] :scope
# @option options [String] :type
Expand All @@ -31,7 +32,7 @@ def company(options = {})

# Retrieve a feed of event items for a Company
#
# @see http://developer.linkedin.com/reading-company-shares
# @see https://developer.linkedin.com/docs/company-pages#company_updates
#
# @macro company_path_options
# @option options [String] :event-type
Expand All @@ -47,7 +48,7 @@ def company_updates(options={})
#
# Permissions: rw_company_admin
#
# @see http://developer.linkedin.com/documents/company-statistics
# @see https://developer.linkedin.com/docs/company-pages#statistics
#
# @macro company_path_options
# @return [LinkedIn::Mash]
Expand All @@ -60,7 +61,7 @@ def company_statistics(options={})
#
# Permissions: rw_company_admin
#
# @see http://developer.linkedin.com/historical-company-statistics#historicalfollowerstatistics
# @see https://developer.linkedin.com/docs/company-pages#historical_followers
#
# @macro company_path_options
# @option options [String] :start-timestamp
Expand All @@ -76,7 +77,7 @@ def company_historical_follow_statistics(options = {})
#
# Permissions: rw_company_admin
#
# @see https://developer.linkedin.com/historical-company-statistics#historicalupdatestatistics
# @see https://developer.linkedin.com/docs/company-pages#historical_updates
#
# @macro company_path_options
# @option options [String] :start-timestamp
Expand All @@ -92,7 +93,7 @@ def company_historical_status_update_statistics(options = {})

# Retrieve comments on a particular company update:
#
# @see http://developer.linkedin.com/reading-company-shares
# @see https://developer.linkedin.com/docs/company-pages#get_update_comments
#
# @param [String] update_key a update/update-key representing a
# particular company update
Expand All @@ -105,7 +106,7 @@ def company_updates_comments(update_key, options={})

# Retrieve likes on a particular company update:
#
# @see http://developer.linkedin.com/reading-company-shares
# @see https://developer.linkedin.com/docs/company-pages#get_update_likes
#
# @param [String] update_key a update/update-key representing a
# particular company update
Expand All @@ -121,8 +122,7 @@ def company_updates_likes(update_key, options={})
#
# Permissions: rw_company_admin
#
# @see http://developer.linkedin.com/creating-company-shares
# @see http://developer.linkedin.com/documents/targeting-company-shares Targeting Company Shares
# @see https://developer.linkedin.com/docs/company-pages#company_share
#
# @param [String] company_id Company ID
# @macro share_input_fields
Expand All @@ -135,7 +135,7 @@ def add_company_share(company_id, share)

# (Create) authenticated user starts following a company
#
# @see http://developer.linkedin.com/documents/company-follow-and-suggestions
# @see https://developer.linkedin.com/docs/company-pages
#
# @param [String] company_id Company ID
# @return [void]
Expand All @@ -146,7 +146,7 @@ def follow_company(company_id)

# (Destroy) authenticated user stops following a company
#
# @see http://developer.linkedin.com/documents/company-follow-and-suggestions
# @see https://developer.linkedin.com/docs/company-pages
#
# @param [String] company_id Company ID
# @return [void]
Expand All @@ -155,10 +155,8 @@ def unfollow_company(company_id)
delete(path)
end


private ##############################################################


def company_path(options)
path = "/companies"

Expand All @@ -171,7 +169,7 @@ def company_path(options)
elsif name = options.delete(:name)
path += "/universal-name=#{CGI.escape(name)}"
elsif is_admin = options.delete(:is_admin)
path += "?is-company-admin=#{CGI.escape(is_admin)}"
path += "?is-company-admin=#{is_admin}"
else
path += "/~"
end
Expand Down