I need to find the user who is logged into the current session. I tried the following but does not work:
Can anyone help me? Thanks in advance!
$.get(CurrentServerAddress + '/service/v4/rest.php', {
method: "get_user_id",
input_type: "JSON",
response_type: "JSON",
rest_data:'"new_get_user_id":["session":"' + SugarSessionId + '"]'
}, function(data) {
if (data !== undefined) {
var userID = jQuery.parseJSON(data);
}
});
I tried the following and it works for me.