Socialid.login.clusteringFeatures
From Social ID Developers
(Difference between revisions)
Renato.neves (Talk | contribs) (→Example) |
Renato.neves (Talk | contribs) |
||
Line 2: | Line 2: | ||
API to get clustering features from the user logged in the current login session. | API to get clustering features from the user logged in the current login session. | ||
− | |||
− | |||
== Usage == | == Usage == |
Latest revision as of 11:48, 25 November 2015
Contents |
Description
API to get clustering features from the user logged in the current login session.
Usage
socialid.login.clusteringFeatures(handler)
Parameters
handler | optional | Callback function to handle the API response. |
---|
API Response
data | Javascript object containing the user clustering features. | 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. |
---|
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("Features " + JSON.stringify(response.data.features)); } else { alert("Could not get clustering features."); } } socialid.login.clusteringFeatures(handler);
Example of "data" object:
data = { "features": { "movies": { "drama": 0.25, "comedy": 0, "sci-fi": 0.5, "horror": 0, "adventure": 0.25 }, "music": { "rock": 0.73, "pop": 0.09, "blues": 0.18, "country": 0 } } }
You can test this parameters in our playground: https://sid-examples.herokuapp.com/social_logins/playground