Socialid.login.updateUserData
From Social ID Developers
Revision as of 16:03, 1 December 2017 by Gabriel.prado (Talk | contribs)
Contents |
Description
API to update 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 retrieved through the getUserData JS API, profile API or directly via Objects APIs.
Usage
socialid.login.updateUserData(data, handler)
Parameters
data | required | data object with the user data information. |
---|---|---|
handler | optional | callback function to handle the API response. |
API Response
status | The API response status. Can be success, if there is an user logged in the current login session and its data was successfully updated, not_found, if there is no user logged in the current login session, or "forbidden", if there is an error with the data parameter. |
---|
Example
Update basic information about the user logged in the current login session:
socialid.login.init(1); var data = { category: "premium" }; var handler = function(response) { if (response.status == "success") { alert("User updated successfully!"); } else { alert("Could not update info from the current logged in user."); } }; socialid.login.updateUserData(data, handler);