Socialid.login.getUserData
(Difference between revisions)
Renato.neves (Talk | contribs)
(Created page with "== Description == API to get custom profile information about the user logged into the current login session. The profile schema can be accessed and updated through [[Datast...")
Newer edit →
(Created page with "== Description == API to get custom profile information about the user logged into the current login session. The profile schema can be accessed and updated through [[Datast...")
Newer edit →
Revision as of 14:19, 16 December 2015
Contents |
Description
API to get custom profile information about the user logged into the current login session.
The profile schema can be accessed and updated through Schema APIs using the schema_name "user_data". The user profile can be updated through the profile update API or directly via Objects APIs using the object_id returned by this API.
Usage
socialid.login.getUserData(handler)
Parameters
handler | optional | callback function to handle the API response. |
---|
API Response
data | Javascript object containing data from the user logged in (see description below). | status | The API response status. Can be success, if there is an user logged in the current login session and its data was successfully retrieved, or not_found, if there is no user logged in the current login session. |
---|
Response Data
The data object properties are at least:
created_at | object created date time. |
---|---|
updated_at | object last updated date time. |
object_id | object id. |
user_id | user id. |
More properties depends on the configuration for the schema "user_data".
Example
Get basic information about the user logged in the current login session:
socialid.login.init(1); var handler = function(response) { if (response.status == "success") { alert("Custom profile information: " + JSON.stringify(response.data)); } else { alert("Could not get info from the current logged in user."); } } socialid.login.getUserData(handler);
Example of "data" object:
data = { created_at: "2015-12-16T12:03:12+00:00", updated_at: "2015-12-16T12:03:12+00:00", object_id: "1231530003cd0bb82e789001", user_id: 632 }
You can test this parameters in our playground: https://sid-examples.herokuapp.com/social_logins/playground