Forum Discussion

nils-drews's avatar
11 years ago
Solved

sort_by for user search

I'd like to get a stable list of users from the search API. I had a look at your SEARCH API and concluded I could do something like:

 

/restapi/vc/search/users?q=(login:[""+TO+*])

 

to get all users that have a login name set. Then I'd like to order them using the registration_time. But using this like follows reuslts in an error:

 

/restapi/vc/search/users?q=(login:[""+TO+*])&sort_by=registration_time

 

like

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<response status="error">
<error code="100">
<message>
Ein unerwarteter Fehler ist aufgetreten.
</message>
</error>
</response>

 

What parameters can sort_by on this API call consume? Which format do we need?

 

Bye, Nils

  •  Hi nils-drews ,

     

    To sort by registration time, you need to add sort_by=reg_date as the query parameter. So the query should be 

    /restapi/vc/search/users?q=(login:[""+TO+*])&sort_by=reg_date

     

    Hope this helps.

     

    Regards,
    Chhama

2 Replies

  •  Hi nils-drews ,

     

    To sort by registration time, you need to add sort_by=reg_date as the query parameter. So the query should be 

    /restapi/vc/search/users?q=(login:[""+TO+*])&sort_by=reg_date

     

    Hope this helps.

     

    Regards,
    Chhama