GET login/connections/:id

From Social ID Developers
Jump to: navigation, search

Contents

Description

Returns user connection information.

This API can be used in the server side to validate the connection_id returned by the Javascript API socialid.login.getConnectionStatus when implementing Single Sign On use case.

Resource URL

  GET https://api.socialidnow.com/v1/marketing/login/connections/:connection_id

Parameters

URL Parameters

connection_id required user connection identifier.
fields optional a list of user profile field names to be returned, joined by commas. See Social Profile Fields.

Authentication

This API requires Login App authentication. See Authentication.

Response

Response Body

connection user active connection url.
connection_id user active connection id.
credential information of the credential the user used to login.
profile a hash with the fields request by the parameter "fields". This field will only be present if at least one field is requested.
user_id user id.
user_token user token. This token is used as user identifier in some Javascript APIs. See Social Login Tokens for more details.

Examples

Without fields

Request

Returns information from connection "1234567890":

 curl -X GET 'https://api.socialidnow.com/v1/marketing/login/connections/1234567890' 

Response

Response Body
 {
   "connection": "https://api.socialidnow.com/v1/marketing/login/connections/1234567890"
   "connection_id": "1234567890",
   "credential": {
     "access_token": "58272",
     "facebook_id": "434242"
     "type": "facebook",
   },
   "user_id": 12345,
   "user_token": "12345678901234567890123456789012",
 }

With fields

Request

Returns information from connection "1234567890" with profile fields birthday, gender and name:

 curl -iX GET 'https://api.socialidnow.com/v1/marketing/login/connections/1234567890?fields=birthday,gender,name' \
 -H 'Accept: application/json'

Response

Response Body
 {
   "connection": "https://api.socialidnow.com/v1/marketing/login/connections/1234567890"
   "connection_id": "1234567890",
   "credential": {
     "access_token": "58272",
     "facebook_id": "434242"
     "type": "facebook",
   },
   "profile": {
     "birthday": "1981-12-15",
     "gender": "male",
     "name": {
       "family_name": "Doe",
       "formatted": "John Doe",
       "given_name": "John",
       "honorific_prefix": null,
       "honorific_suffix": null,
       "middle_name": null
     }
   },
   "user_id": 12345,
   "user_token": "12345678901234567890123456789012",
 }
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox