GET login/info

(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
#REDIRECT [[GET login/info PT-BR]]
+
== Description ==
 +
 
 +
Validates the token given to the callback_url and returns social login information.
 +
 
 +
Use this API to validate the token received by the event [[socialid.events.onLoginSuccess]] or by the callback url configured in the Social Login App (more details in [[Social Login User Guide]]).
 +
 
 +
This API also returns some basic information of the user who logged in through the Social Login Widget, such as name, location, email, picture_url and details of the credential used to perform the login. An optional field "fields" can be used to request additional fields.
 +
 
 +
== Resource URL ==
 +
 
 +
  GET https://api.socialidnow.com/v1/marketing/login/info
 +
 
 +
== Parameters ==
 +
 
 +
=== URL Parameters ===
 +
 
 +
{|
 +
! align="left" width="200px" | api_secret
 +
| width="200px" | required
 +
| Social Login App secret (available in the "Call the API" area of the Social Login App).
 +
|-
 +
! align="left" width="200px" | token
 +
| width="200px" | required
 +
| login token received in the callback_url. See [[Social Login Tokens]] for more details.
 +
|-
 +
! align="left" width="200px" | fields
 +
| width="200px" | optional
 +
| a list of user profile field names to be returned, joined by commas. See [[Social Profile Fields]].
 +
|}
 +
 
 +
== Authentication ==
 +
 
 +
This API does not require HTTP Basic authentication. The authentication is performed by the combination of api_secret and token parameters.
 +
 
 +
== Response ==
 +
 
 +
The following fields are returned:
 +
 
 +
{|
 +
! align="left" width="200px" | connection
 +
| user active connection url.
 +
|-
 +
! align="left" width="200px" | connection_id
 +
| user active connection id.
 +
|-
 +
! align="left" width="200px" | credential
 +
| information of the credential the user used to login.
 +
|-
 +
! align="left" width="200px" | <span style="color: red">email</span>
 +
| <span style="color: red">user e-mail. Warning: this field is deprecated. Use "verified_email" field in the "fields" parameter.</span>
 +
|-
 +
! align="left" width="200px" | <span style="color: red">id</span>
 +
| <span style="color: red">user id. Warning: this field is deprecated. Use "user_id" field in the "fields" parameter.</span>
 +
|-
 +
! align="left" width="200px" | <span style="color: red">location</span>
 +
| <span style="color: red">user current location. Warning: this field is deprecated. Use "current_location" field in the "fields" parameter.</span>
 +
|-
 +
! align="left" width="200px" | <span style="color: red">name</span>
 +
| <span style="color: red">user name. Warning: this field is deprecated. Use "display_name" field in the "fields" parameter.</span>
 +
|-
 +
! align="left" width="200px" | <span style="color: red">picture_url</span>
 +
| <span style="color: red">user picture url. Warning: this field is deprecated. Use "picture_url" field in the "fields" parameter.</span>
 +
|-
 +
! align="left" width="200px" | profile
 +
| a hash with the fields request by the parameter "fields". This field will only be present if at least one field is requested.
 +
|-
 +
! align="left" width="200px" | user_id
 +
| user id.
 +
|-
 +
! align="left" width="200px" | 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 token "56732":
 +
 
 +
  curl -X GET 'https://api.socialidnow.com/v1/marketing/login/info?api_secret=09876&token=56732'
 +
 
 +
==== 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",
 +
    },
 +
    "email": "john.doe@some.domain.com",
 +
    "id": 12345,
 +
    "location": "San Francisco",
 +
    "name": "John Doe",
 +
    "picture_url": "https://facebook.com/picture.png",
 +
    "user_id": 12345,
 +
    "user_token": "12345678901234567890123456789012",
 +
  }
 +
 
 +
=== With fields ===
 +
 
 +
==== Request ====
 +
 
 +
Returns information from token "56732" with profile fields birthday, gender and name:
 +
 
 +
  curl -X GET 'https://api.socialidnow.com/v1/marketing/login/info?api_secret=09876&token=56732&fields=birthday,gender,name'
 +
 
 +
==== 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",
 +
    },
 +
    "email": "john.doe@some.domain.com",
 +
    "id": 12345,
 +
    "location": "San Francisco",
 +
    "name": "John Doe",
 +
    "picture_url": "https://facebook.com/picture.png",
 +
    "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",
 +
  }

Revision as of 00:39, 4 November 2014

Contents

Description

Validates the token given to the callback_url and returns social login information.

Use this API to validate the token received by the event socialid.events.onLoginSuccess or by the callback url configured in the Social Login App (more details in Social Login User Guide).

This API also returns some basic information of the user who logged in through the Social Login Widget, such as name, location, email, picture_url and details of the credential used to perform the login. An optional field "fields" can be used to request additional fields.

Resource URL

  GET https://api.socialidnow.com/v1/marketing/login/info

Parameters

URL Parameters

api_secret required Social Login App secret (available in the "Call the API" area of the Social Login App).
token required login token received in the callback_url. See Social Login Tokens for more details.
fields optional a list of user profile field names to be returned, joined by commas. See Social Profile Fields.

Authentication

This API does not require HTTP Basic authentication. The authentication is performed by the combination of api_secret and token parameters.

Response

The following fields are returned:

connection user active connection url.
connection_id user active connection id.
credential information of the credential the user used to login.
email user e-mail. Warning: this field is deprecated. Use "verified_email" field in the "fields" parameter.
id user id. Warning: this field is deprecated. Use "user_id" field in the "fields" parameter.
location user current location. Warning: this field is deprecated. Use "current_location" field in the "fields" parameter.
name user name. Warning: this field is deprecated. Use "display_name" field in the "fields" parameter.
picture_url user picture url. Warning: this field is deprecated. Use "picture_url" field in the "fields" parameter.
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 token "56732":

 curl -X GET 'https://api.socialidnow.com/v1/marketing/login/info?api_secret=09876&token=56732' 

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",
   },
   "email": "john.doe@some.domain.com",
   "id": 12345,
   "location": "San Francisco",
   "name": "John Doe",
   "picture_url": "https://facebook.com/picture.png",
   "user_id": 12345,
   "user_token": "12345678901234567890123456789012",
 }

With fields

Request

Returns information from token "56732" with profile fields birthday, gender and name:

 curl -X GET 'https://api.socialidnow.com/v1/marketing/login/info?api_secret=09876&token=56732&fields=birthday,gender,name'

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",
   },
   "email": "john.doe@some.domain.com",
   "id": 12345,
   "location": "San Francisco",
   "name": "John Doe",
   "picture_url": "https://facebook.com/picture.png",
   "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