title: How to fetch Linkedin user data?
body: <p>I am using <code>Linkedin API</code> to fetch user content in <code>RoR</code> project. I am following <a href="http://www.sitepoint.com/ruby-social-gems-linkedin/">this</a> blog. Here is controller code:</p>
  
  <p>Basic profile (which works fine)</p>
  
  <pre><code>client = get_client
  profile = client.profile(:fields =&gt; ["first-name", "last-name", "maiden-name", "formatted-name" ,:headline, :location, :industry, :summary, :specialties, "picture-url", "public-profile-url"])
  </code></pre>
  
  <p>Experience and Positions:</p>
  
  <pre><code>client = get_client
  positions = client.profile(:fields =&gt; [:positions]).positions.all
  </code></pre>
  
  <p>For Educations:</p>
  
  <pre><code>client = get_client
  educations = client.profile(:fields =&gt; [:educations]).educations.all
  </code></pre>
  
  <p>Whereas <code>get_client</code></p>
  
  <pre><code>def get_client
  linkedin_oauth_setting = LinkedinOauthSetting.find_by_user_id(current_user.id)
  client = LinkedIn::Client.new('aaadad', 'dadada', @@config)
  client.authorize_from_access(linkedin_oauth_setting.atoken, linkedin_oauth_setting.asecret)
  client
  end
  </code></pre>
  
  <p>For scope I set :</p>
  
  <pre><code>:request_token_path =&gt; '/uas/oauth/requestToken?scope=r_fullprofile'
  </code></pre>
  
  <p>I am able to get Basic profile information but not others. For other fields I am getting empty <code>[]</code>. What am I doing wrong here?</p>