新的LinkedIn权限:使用Rails LinkedIn gem访问过去的职位和教育 [英] New LinkedIn permissions: accessing past positions and educations using rails LinkedIn gem

查看:93
本文介绍了新的LinkedIn权限:使用Rails LinkedIn gem访问过去的职位和教育的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Linkedin最近更新了他们的API,在某些情况下,它对您可以访问的内容的限制不那么严格,但在必须如何访问方面,通常更为明确.

Linkedin recently updated their API, making it less restrictive in terms of what you can access in some cases but generally more explicit in terms of how you must access it.

尤其是,您必须在omniauth构建器中明确要求您想要什么数据:

In particular, you must request specifically what data you want in the omniauth builder:

Rails.application.config.middleware.use OmniAuth::Builder do   
   provider :linkedin, "consumer_key", "consumer_secret", 
      :scope => 'r_fullprofile r_emailaddress r_network', 
      :fields => ["id", "email-address", "first-name", "last-name", "headline", 
            "industry", "picture-url", "public-profile-url", "location", "connections"]   
end

请参阅: https://github.com/skorks/omniauth-linkedin

与引号前面的字段不同(所有字段都是可访问的概要文件信息的一部分),连接"是必须在此处明确请求的结构化对象(默认情况下可以访问前面的字段).

Unlike the fields in quotations that precede it (all of which are part of generally accessible profile information), "connections" is a structured object that must be requested explicitly here (the preceding ones are accessible by default).

我对位置"和教育"字段更感兴趣,像连接"一样是结构化对象.例如,职位包含有关每个职位的公司,职位,开始日期,结束日期的数据:

I'm more interested in "positions" and "educations" fields, which like "connections" are structured objects. For example, positions contains data on company, title, start date, end date per position:

http://developer.linkedin.com/documents/profile-fields

如何在omniauth构建器中对职位和教育领域的字段提出正确的要求?我可以使用旧的API密钥访问它们,但不能使用新发布的API密钥(截至8月).感谢帮助!

How do I make the right request in my omniauth builder for fields within positions and educations? I had access to them with my old API key but not the newly released one (as of August). Help is appreciated!

推荐答案

看起来您正在向应用程序授予 r_fullprofile 权限.这是正确的成员权限.但是,这只会将您的完整个人资料字段授予已认证的用户(位置"和教育"字段由该用户组成).使用您的1级和2级学位,您只能检索具有基本个人资料字段的字段(作为 r_basicprofile 成员权限的一部分)

Looks like you're granting r_fullprofile permissions to your application. That's the correct member permission. However, that will only grant you full profile fields to the authenticated user (of which the Position and Education fields are composed of). With your 1st and 2nd degree connections, you can only retrieve fields that Basic Profile fields (as part of the r_basicprofile member permission)

这篇关于新的LinkedIn权限:使用Rails LinkedIn gem访问过去的职位和教育的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆