Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why linkedin connection rest API gives wrong member id?

Tags:

linkedin

I've application in php and in that I've to fetched all connection of my network from this rest API.

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

But It gives wrong member id. I've checked the same API result in LinkedIn rest console (https://developer.linkedin.com/rest-console) but it gives the different output.

Output with Console :

<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>

Output with rest API from my application :

<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>

please see the tag is different in both the output.

Can anyone help in this?

like image 228
Viral Solani Avatar asked Feb 20 '13 17:02

Viral Solani


1 Answers

Each linkedin application has its own set of unique IDs. The API keys you are using are different from the keys used by the console, this is why you get different IDs.

This is in place in order to ensure that Linkedin data cannot be easily captured by spammers. If the IDs would have been the same, a spammer would setup hundreds of applications, and fetch a number of profile data from each application. Linkedin wants to keep its user data secure.

like image 184
Samer Bechara Avatar answered Jan 01 '23 12:01

Samer Bechara