Search code examples
ruby-on-railsrubyoauth-2.0linkedin-api

Getting details of company which are managed by user - Ruby on Rails


I'm using linkedin-oauth2 gem to implement LinkedIn login and getting details in my ruby on rails application. I'm trying to get the pages managed by the user. IN javascript SDK I could find it like this:

IN.API.Raw("/companies?format=json&is-company-admin=true")

But i could not find any documentation for the same when using ruby on rails.

Is there any way by which this is doable using this gem?


Solution

  • Found an answer after lot of trial and error.

    @all_companies = api.company(is_admin: 'true').all

    This will return an array of objects with the id and name of all the companies manages by the user.