ebs.getUsersOnline
Retrieves the users that are currently logged.
Syntax
| Parameter | Type | Description |
|---|---|---|
callback
|
Function | Callback function to run on the returned result. |
errorCallback
|
Function | Callback function to run in case of failure. |
Return Value
Returns details about the currently logged users in a JSON object that can be used as input for the callback function.
For example:
Copy
{
"UsersOnline": [
{
"OrganizationId": "00000000-0000-0000-0000-000000000000",
"SystemUserId": "c175bfe5-eafd-422f-a57f-7d85e806c38b",
"DisplayName": "Guest__",
"Email": "guest@guest.com",
"BusinessUnitId": "00000000-0000-0000-0000-000000000000",
"ExternalId": null,
"UserName": "Guest",
"IsAdministrator": false,
"IsGuest": false,
"IsAuthorized": false,
"SystemUserTypeId": null,
"Portal": null,
"SecurityRoleIds": null,
"SecurityRoleNames": null,
"Picture": null,
"PhoneNumber": null
},
{
"OrganizationId": "00000000-0000-0000-0000-000000000000",
"SystemUserId": "4afdc8a9-eb91-4359-81d6-c3a462fae866",
"DisplayName": "Administrator",
"Email": "host@change.me",
"BusinessUnitId": "00000000-0000-0000-0000-000000000000",
"ExternalId": null,
"UserName": "host",
"IsAdministrator": false,
"IsGuest": false,
"IsAuthorized": false,
"SystemUserTypeId": null,
"Portal": null,
"SecurityRoleIds": null,
"SecurityRoleNames": null,
"Picture": null,
"PhoneNumber": null
}
]
}
Examples
In the example below:
- We define the logOutput callback function that will list the users that are currently logged in the console log.
- We use the logUsers button to pass the information about the currently logged users to the callback function.
Copy
function logOutput(callbackContent) {
console.log(callbackContent)
}
/* Click event for the logUsers button */
$('#logUsers').on('click', function(event) {
ebs.getUsersOnline(logOutput, null)
});