Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Latest commit

 

History

History
58 lines (46 loc) · 2.44 KB

File metadata and controls

58 lines (46 loc) · 2.44 KB

Directory

The endpoint searches by users or channels on all users and channels available on the workspace.

HTTP MethodURLRequires Auth
GET/api/v1/directoryyes

Query Parameters

This endpoint supports the#pagination parameters, alongside the#query-and-fields parameters.

Body Parameters

KeyExample ValueDescription
query*{"text": "rocket", "type": "users", "workspace": "local"}When type is users, you can send an additional workspace field, that can be local (default) or all. workspace=all will work only if Federation is enabled.

Example Call

curl -G -H "X-Auth-Token: ijFlJ1yfidXhwEYY284Anoq_iEsOeMMVCupzNhX22tB" \
          -H "X-User-Id: hw5DThnhQmxDWnavu" \
          -H "Content-type: application/json" \
          http://localhost:3000/api/v1/directory \
          --data-urlencode 
                    'query={"text": "rocket", "type": "users", "workspace": "local"}'

Example Response

{
    "result": [
        {
            "_id": "jRca8kibJx8NkLJxt",
            "createdAt": "2018-04-13T12:46:26.517Z",
            "emails": [
                {
                    "address": "user.test.1523623548558@rocket.chat",
                    "verified": false
                }
            ],
            "name": "EditedRealNameuser.test.1523623548558",
            "username": "editedusernameuser.test.1523623548558",
            "avatarETag": "6YbLtc4v9b4conXon"
        }
    ],
    "count": 1,
    "offset": 0,
    "total": 1,
    "success": true
}

Change Log

Version Description
1.0.0 Added workspace query param
0.65.0 Added Pagination fields: count, total, offset
0.64.0 Added