Skip to content

Latest commit

 

History

History
96 lines (82 loc) · 2.72 KB

File metadata and controls

96 lines (82 loc) · 2.72 KB

Autocomplete User

List the users whose names match a given pattern.

HTTP MethodURLRequires Auth
GET/api/v1/users.autocompleteyes

Query Parameters

KeyExample ValueDescription
selector*{ "exceptions" : [], "conditions": [], "term": "user"}Filter the response with the parameters.

Example Call

curl  -H 'X-Auth-Token: _2u_4MzRroRcnqc59GYUY_Kwgr9HgtZ9HCKn-2aIvMJ' \
      -H 'X-User-Id: FL2fZL4ERhwA3gWiS' \
      -H "Content-type: application/json" \
      'http://localhost:3000/api/v1/users.autocomplete'

Example Response

Success

{
    "items": [
        {
            "_id": "6esQ6cpqSQYvoLTvC",
            "username": "Aaron.altamirano",
            "status": "offline",
            "name": "Aaron Altamirano ",
            "nickname": "aaron.altamirano@rocket.chat"
        },
        {
            "_id": "AySWYsyzToxy3239z",
            "username": "Balazs.Nemethi",
            "status": "offline",
            "name": "Balázs Némethi"
        },
        {
            "_id": "gxcJTYapi5mPxuAme",
            "username": "Bruno.Solis",
            "status": "offline",
            "name": "Bruno Solis",
            "avatarETag": "ZAHMxLQ6bW426Knwm"
        },
        {
            "_id": "kvqbntLso8y2dEx7C",
            "username": "Ivan.Belousov",
            "status": "offline",
            "name": "Ivan"
        },
        {
            "_id": "AkFjhgJFHAhNK3e6o",
            "status": "offline",
            "name": "Karina Monarkh",
            "username": "Karina"
        },
        {
            "_id": "M3ajjGeyg8SfKXopd",
            "username": "Rucks_guest2",
            "status": "offline",
            "name": "Rucks_guest2",
            "nickname": "anonymous3"
        }
    ],
    "success": true
}

Errors

The following error can occur upon the endpoint.‌

  • Authorization: Requires an authentication token for the request to be made.
  • Selector Param: Requires selector param for the request to be made.

{% tabs %} {% tab title="Authorization" %}

{
    "status": "error",
    "message": "You must be logged in to do this."
}

{% endtab %}

{% tab title="Selector Param " %}

{
    "success": false,
    "error": "The 'selector' param is required"
}

{% endtab %} {% endtabs %}