Socialid.login.updateUserData
From Social ID Developers
(Difference between revisions)
(Created page with "== 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 [[Dat...") |
(→API Response) |
||
Line 26: | Line 26: | ||
{| | {| | ||
! align="left" width="200px" | status | ! align="left" width="200px" | status | ||
− | | The API response status. Can be '''success''' | + | | 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 or if the user data schema is write protected. |
|} | |} | ||
Latest revision as of 20:42, 17 September 2019
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 or if the user data schema is write protected. |
---|
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);