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

Latest commit

 

History

History
53 lines (45 loc) · 1.92 KB

File metadata and controls

53 lines (45 loc) · 1.92 KB

Add Rooms to a Team

HTTP MethodURLRequires Auth
POST/api/v1/teams.addRoomsyes

{% hint style="info" %} Permission required: add-team-channel {% endhint %}

Body Parameters

KeyExample ValueDescription
teamId* or teamName*ByehQjC44FwMeiLbX or team1The team ID or the team name. You must enter either one of the parameters.
rooms*["8dugqGhuRvCBLdZft"]The IDs of the rooms to be added to the team.

Example Call

curl -H 'X-Auth-Token: 8h2mKAwxB3AQrFSjLVKMooJyjdCFaA7W45sWlHP8IzO' \
     -H 'X-User-Id: 8dugqGhuRvCBLdZft' \
     -H 'Content-Type: application/json' \
     http://localhost:3000/api/v1/teams.addRooms \
     -d '{ 
          "teamId": "607e0d9b49d493189836bfac", 
          "rooms": ["8Z7eRsibvD5AANfmK"]}'

Example Response

{
  "rooms": [
    {
      "_id": "8Z7eRsibvD5AANfmK",
      "name": "channelToAddToTeam",
      "fname": "channelToAddToTeam",
      "t": "c",
      "msgs": 0,
      "usersCount": 1,
      "u": {
        "_id": "8dugqGhuRvCBLdZft",
        "username": "some.username"
      },
      "customFields": {},
      "description": "",
      "broadcast": false,
      "encrypted": false,
      "ts": "2021-04-27T19:59:07.258Z",
      "ro": false,
      "_updatedAt": "2021-04-27T19:59:07.313Z",
      "teamId": "607e0d9b49d493189836bfac"
    }
  ],
  "success": true
}