get_contacts Overview

The get_contacts endpoint is used to retrieve a list of the user’s contacts, as well as the contacts’ user data.

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 differ between identity providers.

Most identity providers return only friends (the exceptions are noted below). These identity providers support this call:

  • Facebook
  • Google
  • LinkedIn
  • Microsoft Account
  • Myspace
  • RenRen
  • Salesforce
  • Sina Weibo
  • Soundcloud
  • Twitter—Supports followers, following, and friendships. Does not support friends.
  • VK—Supports friends, followers, and following. Does not support friendships.
  • Yahoo!

Twitter and get_contacts

You can use get_contacts to retrieve an array of a user’s followers or who the user is following.

Examples

A request for followers looks like this:


curl 'https://rpxnow.com/api/v2/get_contacts?apiKey=&identifier=http://twitter.com/id123456789&contactType=followers'

A request for following looks like this:


curl 'https://rpxnow.com/api/v2/get_contacts?apiKey=&identifier=http://twitter.com/id123456789&contactType=following'

A request for friends looks like this:


curl 'https://rpxnow.com/api/v2/get_contacts?apiKey=&identifier=http://twitter.com/id123456789&contactType=friends'

Note. A request for friends is not supported for Twitter.

VK and get_contacts

You can use get_contacts to retrieve an array of a user’s friends, followers, or whom the user is following.

Example

A request for followers looks like this:


curl -X POST \
-d apiKey=1234abcd1234abcd \
-d identifier=http://vk.com/id123456789 \
-d contactType=followers \
https://rpxnow.com/api/v2/get_contacts

A request for following looks like this:


curl -X POST \
-d apiKey=1234abcd1234abcd \
-d identifier=http://vk.com/id123456789 \
-d contactType=following \
https://rpxnow.com/api/v2/get_contacts

A request for friends looks like this:


curl -X POST \
-d apiKey=1234abcd1234abcd \
-d identifier=http://vk.com/id123456789 \
-d contactType=friends \
https://rpxnow.com/api/v2/get_contacts

Note. A request for friendships is not supported for VK.

Response

The following code sample shows the response to the request for followers. The responses to the other requests have a similar format.


{
  "response": {
    "entry": [
      {
        "photos": [
          {
            "value": "http://cs419026.userapi.com/u123456789/e_12345678.jpg",
            "type": "other"
          },
          {
            "value": "http://cs419026.userapi.com/u123456789/d_12345678.jpg",
            "type": "other"
          },
          {
            "value": "http://cs419026.userapi.com/u123456789/12345678.jpg",
            "type": "other"
          }
        ],
        "interests": [
          "Rock Climbing, Skiing, Shuffleboard"
        ],
        "relationships": [
          {
            "value": "Girlfriend",
            "type": "sweetheart"
          }
        ],
        "name": {
          "formatted": "Vkfriend Rpx-Friend",
          "familyName": "Rpx-Friend",
          "givenName": "Vkfriend"
        },
        "books": [
          "1Q84, Rosemary's Baby"
        ],
        "urls": [
          {
            "value": "http://vk.com/id12345678",
            "type": "profile"
          }
        ],
        "profileUrl": "http://vk.com/id12345678",
        "utcOffset": "-08:00",
        "organizations": [
          {
            "name": "Cleveland High School",
            "type": "school"
          }
        ],
        "phoneNumbers": [
          {
            "value": "503-444-3322",
            "type": "home"
          }
        ],
        "aboutMe": "Just hanging about.",
        "tvShows": [
          "Mad Men, Flight of the Concords"
        ],
        "id": "http://vk.com/id12345678",
        "relationshipStatus": "In love",
        "movies": [
          "Dr. Strangeglove, The Expendables.",
          "I also prefer mini series television, which is a lot like movies."
        ],
        "birthday": "1979-05-09",
        "displayName": "Vkfriend Rpx-Friend",
        "gender": "female"
      },
      {
        "photos": [
        {
          "value": "https://vk.com/images/12345678.gif",
          "type": "other"
        },
        {
          "value": "https://vk.com/images/12345678.gif",
          "type": "other"
        },
        {
          "value": "https://vk.com/images/12345678.gif",
          "type": "other"
        }
      ],
      "status": "whoo! status!",
      "name": {
        "formatted": "Vkfriend Rpx-Friend",
        "familyName":"Rpx-Friend",
        "givenName": "Vkfriend"
      },
      "urls": [
        {
          "value": "http://vk.com/id12345678",
          "type": "profile"
        }
      ],
      "profileUrl": "http://vk.com/id184591843",
      "utcOffset": "-08:00",
      "organizations": [
        {
          "name": "Cleveland High School",
          "type": "school"
        }
      ],
      "id": "http://vk.com/id184591843",
      "displayName": "Vkfriend Rpx-Friend",
      "gender": "female"
    },
    {
      "photos": [
        {
          "value": "http://example.com/u12345678/12345678.jpg",
          "type": "other"
        },
        {
          "value": "http://example.com/u12345678/12345678.jpg",
          "type": "other"
        },
        {
          "value": "http://example.com/u12345678/12345678.jpg",
          "type": "other"
        }
      ],
      "interests": [
        "Monkey juggling"
      ],
      "status": "Good.",
      "name": {
        "formatted": "Mr. Example",
        "familyName": "Example",
        "givenName": "Mr."
      },
      "urls": [
        {
          "value": "http://vk.com/id12345678",
          "type": "profile"
        }
      ],
      "profileUrl": "http://vk.com/id12345678",
      "utcOffset": "-08:00",
      "organizations":[
        {
          "department": "Acupuncture",
          "endDate": "1976",
          "name": "Medical School",
          "type": "school"
        },
        {
          "name": "High School",
          "type": "school"
        }
      ],
      "phoneNumbers": [
        {
          "value": "555 555 5556",
          "type": "home"
        },
        {
          "value": "555 555 5555",
          "type": "mobile"
        }
      ],
      "preferredUsername": "Example",
      "tvShows": [
        "Mash",
        "Mr Fink",
        "Sploosh",
        "Ploosh",
        "Smoosh"
      ],
      "id": "http://vk.com/id123456789",
      "movies": [
        "Movie"
      ],
      "birthday": "0000-01-01",
      "displayName": "Mr. Example",
      "gender": "male"
    }
  ],
  "startIndex": 1,
  "itemsPerPage": 3,
  "totalResults": 3
  },
  "stat": "ok"
}