Socialid.login.clusteringFeatures
From Social ID Developers
(Difference between revisions)
Renato.neves (Talk | contribs) (Created page with "== Description == API to get clustering features from the user logged in the current login session. == Usage == socialid.login.getClusteringFeatures(handler) == Paramete...") |
Renato.neves (Talk | contribs) |
||
(3 intermediate revisions by one user not shown) | |||
Line 5: | Line 5: | ||
== Usage == | == Usage == | ||
− | socialid.login. | + | socialid.login.clusteringFeatures(handler) |
== Parameters == | == Parameters == | ||
Line 32: | Line 32: | ||
var handler = function(response) { | var handler = function(response) { | ||
if (response.status == "success") { | if (response.status == "success") { | ||
− | alert("Features " + response.data.features); | + | alert("Features " + JSON.stringify(response.data.features)); |
} else { | } else { | ||
alert("Could not get clustering features."); | alert("Could not get clustering features."); | ||
} | } | ||
} | } | ||
− | socialid.login. | + | socialid.login.clusteringFeatures(handler); |
Example of "data" object: | Example of "data" object: |
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