/get_contacts

Uses the apiKey and identifier parameters to return a list of all the contacts related to a given user. The data returned and the type of relationship differs between Identity Providers.

Before using this endpoint you must enable contacts for the Identity Provider in the Social Login Dashboard.

The Identity Providers that support this call are:

  • Facebook — Only for apps created before April 30, 2014; apps created after this date do not have access to get_contacts. Please refer to this support notification for more information.
  • Twitter — Does not support friend, but does support followers, following, and friendships. See get_contacts Response for more details.
  • Yahoo!
  • Salesforce
  • Disqus
  • Mixi
  • Sina Weibo
  • Tumblr
  • VK — Does not support friendships, but does support friends, followers, and following. See get_contacts Response for more details.

This endpoint includes the following methods:

  • POST


POST

Authentication

This endpoint uses your social login API key for authentication. This key can be found on the Settings page of the Social Login Dashboard.

Accepted Content-types

  • application/x-www-form-urlencoded
  • multipart/form-data

Base URL

The base URL for this endpoint is your application domain followed by /api/v2; for example:

https://educationcenter.rpxnow.com/api/v2

You can find your application domain in the Social Login (Engage Dashboard) on the Settings page:

Example Request

This command returns contact information for the user with the Facebook identifier http://www.facebook.com/profile.php?id=999444055333393390.


curl -X POST \
  --data-urlencode apiKey=1234567891234567891234567891234567891234 \
  --data-urlencode identifier=http://www.facebook.com/profile.php?id=999444055333393390 \
  --data-urlencode contactType=friends \
  https://janrain-docs.rpxnow.com/api/v2/get_contacts
    
      Running this command in Postman

Example Response


{
  "response": {
    "startIndex": 1,
    "entry": [
      {
        "emails": [
          {
            "type": "other",
            "value": "bob@example.com"
          }
        ],
        "displayName": "Bob Johnson"
      },
      {
        "emails": [
          {
            "type": "other",
            "value": "cindy.smith@example.com"
          }
        ],
        "displayName": "Cindy Smith"
      },
      {
        "emails": [
          {
            "type": "other",
            "value": "fred.williams@example.com"
          }
        ],
        "displayName": "Fred Williams"
      },
      {
        "emails": [
          {
            "type": "other",
            "value": "j.lewis@example.com"
          }
        ]
      },
      {
        "emails": [
          {
            "type": "other",
            "value": "mary.jones@example.com"
          }
        ],
        "displayName": "Mary Jones"
      },
      {
        "emails": [
          {
            "type": "other",
            "value": "p.green@example.com"
          }
        ],
        "displayName": "Patricia Green"
      }
    ],
    "itemsPerPage": 5,
    "totalResults": 5
  },
  "stat": "ok"
}    

Query Parameters

Parameter Type Required Description
apiKey string Yes Social Login API key. This key can be found on the Social Login Dashboard.
 
contactType string Specify friends to return identifiers for every friend of the user. If you do not specify a value, friends will be returned if available.

Twitter does not support the friends contactType. Instead specify followers, following, or friendships. If you do not specify a value, following will be returned.
 
  • followers – the people following the user.
  • following – the people the user is currently following. 
  • friendships – The people for whom followers and following are both true.

Note that VK supports followers and following, but not friendships. No other providers support any of these values, and will return an error.

existingUser string When set to true, returns a value that identifies whether a user has previously authenticated with an Identity Cloud application.
 
identifier string Yes Identifier returned from the auth_info API call.

The application must be configured to request this information in the Provider Configuration screen. In addition, the visitor must approve this request during sign-in. The auth_info access Credentials section includes an expiration time for the permissions that enable get_contacts. This call must be made before the expiration time.
 
providerFields string Comma-separated list of provider specific profile fields to return the associated data. This option is supported by Facebook, LinkedIn, Mixi, Salesforce, VK, and Xing, and is ignored if used with other providers.

Note that no validation is performed: if you specify an incorrect field name then an error is likely to occur. Check the provider's documentation for valid profile fields.
 

Responses

200 OK

Response Fields

Field

Type

Description

response

array

User Profile data representing the address book contents for the identifier.