/get_contacts

The get_contacts call uses the apiKey and identifier to return a list of all the contacts related to the user. The data returned and the type of relationship differs between Identity Providers.

Before using get_contacts you must enable contacts for the Identity Provider in the Janrain Dashboard.

The Identity Providers that support this call are:

  • Facebook — Only for apps created before April 30th, 2014. Apps created after this date do not have access to get_contacts. Please refer to this support notification for more information.
  • Google — Deprecated
  • Twitter — Does not support friends. Does support followers, following, and friendships. See get_contacts Response for more details.
  • Yahoo!
  • Windows Live
  • Salesforce
  • Disqus
  • Mixi
  • Myspace
  • Sina Weibo
  • RenRen
  • Soundcloud
  • Tencent Weibo
  • Tumblr
  • VK — Does not support friendships. Does support friends, followers, and following. See get_contacts Response for more details.

Accepted Content-types

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

This endpoint includes the following methods:

  • POST


POST

Authentication

This endpoint supports Basic authentication. 

How to Create an Authentication String

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


curl -X POST \
    --data-urlencode apiKey=1234567891234567891234567891234567891234\
    --data-urlencode identifier=0987098709870987 \
    --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 Janrain 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 the Janrain 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 Faceboo, 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.