Connection API \ Read connection details

Send a GET request to this resource to retrieve the details of a social network connection made on your Site.

Resource/URI GET POST PUT DELETE
Connections /connections.<format> List all connections
Connection /connections/<connection_token>.<format> Retrieve connection data

Workflow

1. Request: the code to send to the API

Send a GET request to the resource /connections/<connection_token>.<format> in order to retrieve the details of a connection. The <connection_token> has to be replaced by the connection_token that our system previously send as POST data to your callback script.

More details about using the connection API in your callback handler script is available in our implementation guide.

Connection API

2. Result: the code returned by the API

The connection includes the full user profile data retrieved from the social network (Facebook, Twitter, LinkedIn ...). The data is wrapped into the Portable Contacts Format. Please note that the user profile may contain more or less data depending on the provider.

Example of a successfull connection:

{
	"response": {
		"request": {
			"date": "Thu, 25 Aug 2011 13:38:21  0200",
			"resource": "/connections/8875cb47-9b2e-40f9-8ae0-8428c06937a9.json",
			"status": {
				"flag": "success",
				"code": 200
			}
		},
		"result": {
			"status": {
				"flag": "success",
				"code": 200,
				"info": "The user successfully authenticated"
			},
			"data": {
				"connection": {
					"connection_token": "8875cb47-9b2e-40f9-8ae0-8428c06937a9",
					"date": "Thu, 25 Aug 2011 13:35:40 +0200",
					"plugin": "social_link"					
				},                        
				"user": {
					"user_token": "12345678-1234-1234-1234-123456789012",
					"identity": {
						"identity_token": "a3ba5j55-aacc-25ag-a4ah-ga4ahab3a2aa",
						"provider": "twitter",
						"id": "http://twitter.com/ExampleUser",
						"displayName": "Firstname Lastname",
						"name": {
							"formatted": "Firstname Lastname"
						},
						"preferredUsername": "MyUserNameRocks",
						"thumbnailUrl": "http://a1.twimg.com/sticky/default_profile_images/default_profile_6_normal.png",
						"urls": [{
								"value": "http://twitter.com/ExampleUser",
								"type": "profile"
							}
						],
						"accounts": [{
							"domain": "twitter.com",
							"userid": "123456789",
							"username": "ExampleUser"
							}
						],
						"photos": [{
								"value": "http://a1.twimg.com/sticky/default_profile_images/default_profile_6_normal.png",
								"type": "thumbnail"
							}
						]
					}
				}
			}
		}
	}
}