jaread83
8 years agoChampion
Online users API call - what order are these results?
Hi all,
I am using the API V1 call for online and registered users on a custom component:
<#assign users = rest("/users/online/registered?page_size=100").users />
I was wondering... how are these results ordered? I can't seem to find any clear indication of the order of the online users here. If the order is not determined... how can I tell the API call to order them in a way that I wanted (like last visit time for example).
Use this one with sort direction parameter
Note: ASC or DESC does not work here, need to use either ascending or descendinghttp://community.lithium.com/community-name/restapi/vc/users/online/sort_by/last_visit/order/[sort_direction]
Here is the documentation
Here is the exact call you are finding
/restapi/vc/users/online/registered?users_online.sortby=-last_visit
/restapi/vc/users/online/registered?users_online.sortby=+last_visit