2

I am using Linkedin API to fetch user content in RoR project. I am following this blog. Here is controller code:

Basic profile (which works fine)

client = get_client
profile = client.profile(:fields => ["first-name", "last-name", "maiden-name", "formatted-name" ,:headline, :location, :industry, :summary, :specialties, "picture-url", "public-profile-url"])

Experience and Positions:

client = get_client
positions = client.profile(:fields => [:positions]).positions.all

For Educations:

client = get_client
educations = client.profile(:fields => [:educations]).educations.all

Whereas get_client

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

For scope I set :

:request_token_path => '/uas/oauth/requestToken?scope=r_fullprofile'

I am able to get Basic profile information but not others. For other fields I am getting empty []. What am I doing wrong here?

4

1 に答える 1

2

このデータにアクセスするには、Linkedin に特別な承認を求める必要があると思います。r_fullprofile登録済み API 専用です。

  • 特別な権限を必要としないデータ: r_basicprofile
  • LinkedIn パートナーシップ プログラムの申請に必要なデータ: r_fullprofile (こちら を参照)

Linkedin の Web サイトでこのドキュメントを参照してください。

Linkedin のプログラムに申し込むには、このページにアクセスしてください

今朝申し込んだところ、15日以内に戻ってくるとのことでした。

幸運を!

于 2015-11-24T10:34:58.517 に答える