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

Latest commit

 

History

History
61 lines (51 loc) · 2.21 KB

list-user-rooms-of-a-team.md

File metadata and controls

61 lines (51 loc) · 2.21 KB

List User Rooms of a Team

Lists only the team's rooms the user has joined.

HTTP MethodURLRequires Auth
GET/api/v1/teams.listRoomsOfUseryes

{% hint style="info" %} Permission required: view-all-team-channels {% endhint %}

Query Parameters

This endpoint supports the offset and count parameters for#pagination query parameters.

KeyExample ValueDescription
teamId* or teamName*ByehQjC44FwMeiLbX or team1The team ID or the team name. You must enter either one of these parameters.
userId*LrTDRE27fWPEvaAwCThe user ID (the endpoint returns the team channels this user has joined).

Example Call

{% code overflow="wrap" %}

curl  -H 'X-Auth-Token: _2u_4MzRroRcnqc59GYUY_Kwgr9HgtZ9HCKn-2aIvMJ' \
      -H 'X-User-Id: FL2fZL4ERhwA3gWiS' \
      -H "Content-type: application/json" \
      'http://localhost:3000/api/v1/teams.listRoomsOfUser?teamName=team1&userId=LrTDRE27fWPEvaAwC'

{% endcode %}

Example Response

{
  "rooms": [
    {
      "_id": "8Z7eRsibvD5AANfmK",
      "name": "someChannel",
      "fname": "someChannel",
      "t": "c",
      "msgs": 7,
      "usersCount": 1,
      "u": {
        "_id": "FL2fZL4ERhwA3gWiS",
        "username": "some.username"
      },
      "customFields": {},
      "description": "",
      "broadcast": false,
      "encrypted": false,
      "ts": "2021-04-27T19:59:07.258Z",
      "ro": false,
      "_updatedAt": "2021-04-28T20:57:18.362Z",
      "teamId": "607e0d9b49d493189836bfac",
      "teamDefault": true,
      "isLastOwner": true
    }
  ],
  "total": 1,
  "count": 1,
  "offset": 0,
  "success": true
}