2013-02-20 36 views
5

我在PHP中的应用程序,并且我必须从这个其他API获取我的网络的所有连接。为什么linkedin连接rest API给出错误的成员id?

http://api.linkedin.com/v1/people/~/connections?modified=new

但是它给出错误的会员ID。我在LinkedIn休息控制台(https://developer.linkedin.com/rest-console)中检查了相同的API结果,但它给出了不同的输出。

输出与控制台:

<person> 
    <id>nzdqEWJjKM</id> 
    <first-name>Sagar</first-name> 
    <last-name>Modi</last-name> 
    <headline>Sr. HR Officer - Generalist at MAS Financial Services Ltd.</headline> 
    <picture-url>http://m3.licdn.com/mpr/mprx/0_3vxs_YPyEsnVrHXzT-Jd_pvlox-zraqzitwL_pt_zJ6LfEivSP7nDy6SXttoPdzJhngkuU2v-HG2</picture-url> 
    <api-standard-profile-request> 
     <url>http://api.linkedin.com/v1/people/nzdqEWJjKM</url> 
     <headers total="1"> 
     <http-header> 
      <name>x-li-auth-token</name> 
      <value>name:PSbh</value> 
     </http-header> 
     </headers> 
    </api-standard-profile-request> 
    <site-standard-profile-request> 
     <url>http://www.linkedin.com/profile/view?id=54732271&authType=name&authToken=PSbh&trk=api*a108281*s116823*</url> 
    </site-standard-profile-request> 
    <location> 
     <name>Ahmedabad Area, India</name> 
     <country> 
     <code>in</code> 
     </country> 
    </location> 
    <industry>Human Resources</industry> 
    </person> 

输出与其余的API从我的应用程序:

<person> 
    <id>7dmJjxBx_k</id> 
    <first-name>Sagar</first-name> 
    <last-name>Modi</last-name> 
    <headline>Sr. HR Officer - Generalist at MAS Financial Services Ltd.</headline> 
    <picture-url>http://m3.licdn.com/mpr/mprx/0_3vxs_YPyEsnVrHXzT-Jd_pvlox-zraqzitwL_pt_zJ6LfEivSP7nDy6SXttoPdzJhngkuU2v-HG2</picture-url> 
    <api-standard-profile-request> 
     <url>http://api.linkedin.com/v1/people/7dmJjxBx_k</url> 
     <headers total="1"> 
     <http-header> 
      <name>x-li-auth-token</name> 
      <value>name:PSbh</value> 
     </http-header> 
     </headers> 
    </api-standard-profile-request> 
    <site-standard-profile-request> 
     <url>http://www.linkedin.com/profile/view?id=54732271&amp;authType=name&amp;authToken=PSbh&amp;trk=api*a184885*s193024*</url> 
    </site-standard-profile-request> 
    <location> 
     <name>Ahmedabad Area, India</name> 
     <country> 
     <code>in</code> 
     </country> 
    </location> 
    <industry>Human Resources</industry> 
    </person> 

请参阅标签是在两个不同的输出。

任何人都可以帮忙吗?

回答

7

每个linkedin应用程序都有自己的一组唯一ID。您使用的API密钥与控制台使用的密钥不同,这就是您获取不同ID的原因。

这是为了确保Linkedin数据不容易被垃圾邮件发送者捕获。如果ID相同,垃圾邮件发送者将设置数百个应用程序,并从每个应用程序中获取一些配置文件数据。 Linkedin希望保证其用户数据的安全。

+0

谢谢。我试着用我的应用程序获得的ID。其实我只是因为ID的差异而感到困惑。非常感谢您的帮助。 – 2013-02-21 16:16:28

+0

哇。这一点在文档中都没有提及,或者我完全忽略了它。谢谢! – Relequestual 2014-04-29 13:50:03

+0

什么能够防止垃圾邮件发送者设置数百个应用程序并获取多个配置文件?垃圾邮件发送者寻找个人信息,而不是用于固定ID或不断变化的ID。 – 2014-07-04 15:35:21