List the public and private rooms whose names match a given string, excluding discussions, DMs, and omnichannel rooms. The endpoint is valuable when performing search operations. It returns only rooms that the user belongs to.
HTTP Method | URL | Requires Auth |
---|---|---|
GET | /api/v1/rooms.autocomplete.channelAndPrivate | yes |
Key | Example Value | Description |
---|---|---|
selector * | {"name":"ran"} | The term to be completed. It only applies to room name. |
{% code overflow="wrap" %}
curl --location --request GET 'http://localhost:3000/api/v1/rooms.autocomplete.channelAndPrivate?selector=[]\
--header 'X-Auth-Token: myauth-token' \
--header 'X-User-Id: myuser-name'
{% endcode %}
{
"items": [
{
"_id": "664f0d525df46832f75b1860",
"fname": "rancher",
"name": "rancher",
"t": "p"
},
{
"_id": "6630e94ad2226209149c67e2",
"fname": "random",
"name": "random",
"t": "c"
},
{
"_id": "664f148f5df46832f75b18b2",
"fname": "ranmowe",
"name": "ranmowe",
"t": "p"
}
],
"success": true
}
The following errors can occur:
- 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 %}