Connection API \ Read connection details PHP SDK
Resource/URI | GET |
---|---|
Connections
/connections.json
|
List all connections |
Connection
/connections/<connection_token>.json
|
Retrieve connection data |
Workflow
Request: the code to send to the API
Send a GET
request to the resource /connections/<connection_token>.json
in order to retrieve the user data of a connection.
A connection is created when a user manually logs in with a social network or when the user is automatically logged in by our Single Sign-On service.
Once the user has connected, the connection_token
is send as POST
data to your callback script.
If you have enabled the data encryption for your OneAll site, then the user data is fully encrypted and needs to be decoded using the
identity_vault_key
included in the POST
data.
More details about creating a callback script are available in our implementation guides.
Result: the code returned by the API
The connection includes the user data retrieved during the connection. More or less data is available depending on the social network and the settings in your OneAll account. Please refer to the Identity Structure for a complete description of the identity node.
Example Resultset
{ "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" } ] } } } } } }