LinkedIn API - how to request the total number of connections?

I am trying to query the total number of connections like this:

/people/id=QM86-RIKjb:(connections total)

and using an example API here: https://developer.linkedin.com/documents/profile-api

in the xml example, this field is shown at the bottom: <connections total="" >

I try to request it, but I get an exception that I have a bad URI:

URI::InvalidURIError: bad URI(is not URI?): /v1/people/id=QM86-RIKjb:(connections total)

What am I doing wrong? Is there a proper way to request such parameters?

Thank!

+3
source share
2 answers

To get the number of connections from the profile API, you can directly access the API:

http://api.linkedin.com/v1/people/id=nbqwYraDfd:(num-connections,num-connections-capped)

which will return (depending on the number of connections):

<?xml version="1.0" encoding="UTF-8"?>
<person>
  <num-connections>500</num-connections>
  <num-connections-capped>true</num-connections-capped>
</person>

, , . . . , " " - nbqwYraDfd , :

http://api.linkedin.com/v1/people/id=nbqwYraDfd:(connections)

:

<?xml version="1.0" encoding="UTF-8"?>
<person>
  <connections total="XXX" count="YYY" start="0">
    <person>
    ...
    </person>
  </connections>
</person>

total, XML ( ).

, nbqwYraDfd -, 403:

<?xml version="1.0" encoding="UTF-8"?>
<error>
  <status>403</status>
  <timestamp>1337954306491</timestamp>
  <request-id>25P44ZN249</request-id>
  <error-code>0</error-code>
  <message>Access to other member connections denied</message>
</error>
+3

( )

,

http://api.linkedin.com/v1/people/id=nbqwYraDfd:(connections)

, XML, , total connections.

, ,

http://api.linkedin.com/v1/people/id=nbqwYraDfd:(connections:())

, , XML.

+4

All Articles