/get_contacts   Demo console

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 type of relationship differs between Identity Providers.

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
  • Google+
  • Twitter — Does not support friends. Does support followers, following, and friendships. See get_contacts Response for more details.
  • Yahoo!
  • LinkedIn —  r_network permission is required to use get_contacts.
  • 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

Endpoint URL

POST https://{your-engage-domain.com}/api/v2/get_contacts

Request Parameters

Parameter ReqRequired Description
apiKey
string
Yes

Your Janrain API key.

identifier
string
Yes

The 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 accessCredentials section includes an expiration time for the permissions that enable get_contacts. This call must be made before the expiration time.

contactType
string
No

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. For Google+ this includes the users “circles.”
  • friendships – The people for whom followers and following are both true.
  • addressBook – this value is for Google+ only, it gets the user’s whole address book.

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

format
string
No

The format in which you want the response: either xml or json. If not specified, the response defaults to json.

existingUser
string
No

Values are true and false. If true returns a value that identifies if a user has previously authenticated with the Janrain application before.

Available to the following providers: Facebook, Twitter, LinkedIn, Salesforce, Mixi, Disqus, Tumblr, Sina Weibo, RenRen, Soundcloud, and VK.

providerFields
string
No

Supported by facebook, linkedin, mixi, salesforce, vk and xing. This parameter is ignored for unsupported providers.

Define a comma-separated list of provider specific profile fields to return the associated data.

Note: No validation is performed. Passing the wrong field names might result in an error. Consult the provider’s documentation for valid profile fields.

Response

Parameter Type Description
responsearray

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

Example Request



curl -X POST 
-d apiKey=1234567891234567891234567891234567891234 
-d identifier=0987098709870987 
-d contactType=friends 

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

{
  "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"
}
<?xml version='1.0' encoding='UTF-8'?>
<rsp stat='ok'>
  <response>
    <startIndex>
      1
    </startIndex>
    <itemsPerPage>
      5
    </itemsPerPage>
    <totalResults>
      5
    </totalResults>
    <entry>
      <displayName>
        Bob Johnson
      </displayName>
      <emails>
        <email>
          <type>
            other
          </type>
          <value>
            bob@example.com
          </value>
        </email>
      </emails>
    </entry>
    <entry>
      <displayName>
        Cindy Smith
      </displayName>
      <emails>
        <email>
          <type>
            other
          </type>
          <value>
            cindy.smith@example.com
          </value>
        </email>
      </emails>
    </entry>
    <entry>
      <displayName>
        Fred Williams
      </displayName>
      <emails>
        <email>
          <type>
            other
          </type>
          <value>
            fred.williams@example.com
          </value>
        </email>
      </emails>
    </entry>
    <entry>
      <emails>
        <email>
          <type>
            other
          </type>
          <value>
            j.lewis@example.com
          </value>
        </email>
      </emails>
    </entry>
    <entry>
      <displayName>
        Mary Jones
      </displayName>
      <emails>
        <email>
          <type>
            other
          </type>
          <value>
            mary.jones@example.com
          </value>
        </email>
      </emails>
    </entry>
    <entry>
      <displayName>
        Patricia Green
      </displayName>
      <emails>
        <email>
          <type>
            other
          </type>
          <value>
            p.green@example.com
          </value>
        </email>
      </emails>
    </entry>
  </response>
</rsp>