Share via


Primary Contacts of Other Members

Note

The use of this API is restricted to those developers approved by LinkedIn and subject to applicable data restrictions in their agreements.

This API returns primary handles of specified LinkedIn members. A handle represents the member's contact information and can be an email or a phone number. To retrieve a member's handle, you will need access to the person ID, available only via certain limited access APIs and subject to member privacy settings.

Usage

You must use an access token to make an authenticated call on behalf of a user.

Permission

Permission Description
r_network_primarycontact Retrieve other member’s primary contact.

Retrieve Other Member’s Primary Contact

To query for the specified members' primary contacts information, you can use the sample request below. Make sure your request has the the appropriate authentication.

GET https://api.linkedin.com/v2/clientAwareMemberHandles?q=members&members=List({Person URN 1},{Person URN 2},{Person URN 3})

Note

The query parameter "q=members" is always required, called Finder members in v2 APIs and represents querying by members to find their associated handles. The "projection" parameter customizes the response you are expecting the API to return. Please check 'Request Methods' and 'Projections' sections at out v2 API Concepts page for more details.

Multiple Values Parameters

LinkedIn APIs are built at the top of Rest.Li framework, and you need to pass List({value 1}, {value 2}, {value 3}) into the url to specify a parameter which has multiple values.

Rest.Li Version

Currently X-RestLi-Protocol-Version:2.0.0 must be specified into request header to make sure API call accept multiple values format above.

Encoding and Decoding

: is a special character on Rest.Li framework to indicate key-value pair, so : in a URN must be encoded as %3A, and other characters are decoded to make sure URNs be distinguished.

Reference Table

The response body is in JSON and always include the field elements that contains an array of handles belonging to the member. Fields are as follow:

Contact Field Type Description
member URN Person URN, indicates a member’s one primary contacts.
handle URN emailAddress/phoneNumber URN, indicates a member’s email address or phone number.
primary Boolean Indicates if the handle is primary or not.
type String Indicates the type of handle. It can be either EMAIL or PHONE.

sample response

{
  "elements" : [ {
    "member" : "urn:li:person:9HfhE6QlBz",
    "handle" : "urn:li:emailAddress:-279",
    "type" : "EMAIL",
    "primary" : true
  }, {
    "member" : "urn:li:person:onq5lulICk",
    "handle" : "urn:li:emailAddress:150",
    "type" : "EMAIL",
    "primary" : true
  }, {
    "member" : "urn:li:person:YnLx6MCuZ5",
    "handle" : "urn:li:phoneNumber:9823",
    "type" : "PHONE",
    "primary" : true
  }, {
    "member" : "urn:li:person:YnLx6MCuZ5",
    "handle" : "urn:li:emailAddress:138",
    "type" : "EMAIL",
    "primary" : true
  } ],
  "paging" : {
    "count" : 10,
    "start" : 0,
    "links" : [ ]
  }

Email Or Phone Number

In order to get the actual email or phone number, the handle field must be decoded via projection parameter. The sample query is as below:

GET https://api.linkedin.com/v2/clientAwareMemberHandles?q=members&members=List({Person URN 1},{Person URN 2},{Person URN 3})&projection=(elements*(member,handle~))

The decoded contact info can be one of the following fields:

Fields Sub-fields Description
handle~ Indicates successful decoded member handle
emailAddress Indicates the user’s primary email address.
handle~ Indicates successful decoded member handle
phoneNumber Indicates the user’s primary phone number
countryCode Indicates country code of the phone number.

sample code

{
  "elements" : [ {
    "member" : "urn:li:person:9HfhE6QlBz",
    "handle" : "urn:li:emailAddress:-279",
    "handle~" : {
      "emailAddress" : "stub1@stub.com"
    }
  }, {
    "member" : "urn:li:person:onq5lulICk",
    "handle" : "urn:li:emailAddress:150",
    "handle~" : {
      "emailAddress" : "stub2@stub.com"
    }
  }, {
    "member" : "urn:li:person:YnLx6MCuZ5",
    "handle" : "urn:li:phoneNumber:9823",
    "handle~" : {
      "phoneNumber" : {
        "number" : "+86 3333333333"
      },
      "countryCode" : "CN"
    }
  }, {
    "member" : "urn:li:person:YnLx6MCuZ5",
    "handle" : "urn:li:emailAddress:138",
    "handle~" : {
      "emailAddress" : "stub@stub.com"
    }
  } ]