Search and Query Users
Last updated
Was this helpful?
Last updated
Was this helpful?
Query for users by their display name, receiving a collection of AmityUser
matching your search. It requires two parameters: the display name you're searching for, and a 'sort option' from the AmityUserSortOption
enum. If no keyword is supplied, the list of users will be organized alphabetically by display name.
Users also have the option to sort by lastCreated
, firstCreated
, or displayName
. When a keyword is provided, the list will be arranged based on search rank. The displayName
sorting option will be specified by default if it isn't specified.
With the displayName
sorting option, users are sorted alphabetically by their display names using ICU collation for the English locale. This means that special characters such as Ä are treated as variants of A. For example, a sorted list might appear as:
adam, Älex, Alice, Arthur, charlie, Kristen
.
When providing a search keyword, the API performs an exact-match lookup for special characters.
For instance, if you search for "Äli", only users whose display name contains the "Äli" characters (e.g., "Älise") will be returned.
Conversely, searching for "Alice" will not return "Älice".
Query for users to receive a collection of AmityUser
based on a single parameter: a 'sort option' from the AmityUserSortOption
enum. Sort the list by options such as displayName
, firstCreated
, or lastCreated
. The displayName
sort option will be specified by default if it isn't specified.
With the displayName
sorting option, users are sorted alphabetically by their display names using ICU collation for the English locale. This means that special characters such as Ä are treated as variants of A. For example, a sorted list might appear as:
adam, Älex, Alice, Arthur, charlie, Kristen
.