Forum Discussion

SamuelS1's avatar
SamuelS1
Contributor
6 years ago

Online users count

Hi,

How I can get sum of users and guest that are currently online? I see those data in Users Online (separately for registered users and anonymous guests) component but when I do API request

/users/online/count

I get different result then sum of registered users online and anonmous guests online form Users Online Component.

For example, in Users Online shows:

Online: 4 users, 153 guests

and from api call I get:

175

How can I get total number of online registered users and anonymous guest? 

  • SamuelS1 
    Seems like API returning all the users, despite their permissions(even they do not want to show themselves online) But OOTB components works respectively to the user's permissions either user itself want to show their status online or not. See here https://prnt.sc/mhvtgp

    Note: Use rest call to give respect to the users permissions. 

    • SamuelS1's avatar
      SamuelS1
      Contributor

      Thank you for the clarification. :smileyhappy:

      How should I modify API request to get all online users respectively to the user's permissons, so the values form custom components and OOTB Component will be consistent?