Identity API \ Read the contacts of an identity PHP SDK

Resource/URI - Common GET POST PUT DELETE
Identities /identities.json List all identities
Identity /identities/<identity_token>.json Read identity details Delete identity
Identity /identities/<identity_token>/link.json ReLink identity
Identity /identities/<identity_token>/synchronize.json Synchronize identity
Identity /identities/<identity_token>/contacts.json Read identity contacts
Resource/URI - Provider Specific GET POST PUT DELETE
Steam Games /identities/<identity_token>/steam/games.json List all Steam games
Facebook Posts /identities/<identity_token>/facebook/posts.json List all Facebook posts

Workflow

Request: the code to send to the API

Send a GET request to the resource /identities/<identity_token>/contacts.json to retrieve the contacts of an identity. The <identity_token> has to be replaced by the unique token of an existing identity.

This endpoint works with Facebook, Twitter, LinkedIn, Google, Yahoo and Microsoft identities. To be able to retrieve a user's contacts, it might be necessary to enable the corresponding permissions in the settings of the social network in your OneAll account.

Result: the code returned by the API

The API will retrieve the user's contacts from his social network profile and return a normalized list. Requests that return multiple entries will be paginated to 250 items by default. The results of this endpoint are cached and updated once per day.

Example Resultset

{
  "response": {
    "request": {
      "date": "Tue, 06 Jun 2017 14:41:58  0200",
      "resource": "/identities/923843ec-1749-4cc1-988f-d6963f3b1baa/contacts.json",
      "status": {
        "flag": "success",
        "code": 200,
        "info": "Your request has been processed successfully"
      }
    },
    "result": {
      "data": {
        "cache": {
          "has_been_used": true,
          "date_last_update": "Tue, 06 Jun 2017 14:41:57 +0200",
          "date_next_update": "Wed, 07 Jun 2017 14:41:57 +0200"
        },
        "contacts": {
          "pagination": {
            "current_page": 1,
            "total_pages": 1,
            "entries_per_page": 200,
            "total_entries": 3,
            "order": {
              "field": "id",
              "direction": "asc"
            }
          },
          "count": 3,
          "entries": [
            {
              "name": {
                "formatted": "John Miller"
              },
              "email": "jmiller@example.com",
              "profileUrl": "https://www.facebook.com/profile.php?id=1111111111",
              "thumbnailUrl": "https://graph.facebook.com/1111111111/picture?type=small",
              "provider_properties": {
                "key": "1111111111",
                "flags": "friend_of_this_user"
              }
            },
            {
              "name": {
                "formatted": "Robert Doe"
              },
              "email": "rdoe@example.com",
              "profileUrl": "https://www.facebook.com/profile.php?id=2222222222",
              "thumbnailUrl": "https://graph.facebook.com/2222222222/picture?type=small",
              "provider_properties": {
                "key": "2222222222",
                "flags": "friend_of_this_user"
              }
            },
            {
              "name": {
                "formatted": "Susan Nicolson"
              },
              "email": "snicolson@example.com",
              "profileUrl": "https://www.facebook.com/profile.php?id=3333333333",
              "thumbnailUrl": "https://graph.facebook.com/3333333333/picture?type=small",
              "provider_properties": {
                "key": "3333333333",
                "flags": "friend_of_this_user"
              }
            }  
          ]
        }
      }
    }
  }
}

User Contributed Notes