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

Latest commit

 

History

History
55 lines (45 loc) · 2.47 KB

File metadata and controls

55 lines (45 loc) · 2.47 KB

Create Discussion

Creates a new discussion for the room. It requires at least one of the following permissions: start-discussion OR start-discussion-other-user, AND must be with the following setting enabled: Discussion_enabled.

HTTP MethodURLRequires Auth
POST/api/v1/rooms.createDiscussionyes

Body Parameters

KeyExample ValueDescription
prid*GENERALParent room ID of the discussion.
t_name*discussion nameDiscussion name.
users['rocket.cat']Array of users to join in the discussion, if not provided, it will be an empty array. (Note: if provided, it must be an array).
pmidaobEgbghXfe543keqGParent message ID (if the discussion comes from a message).
replyreply of this discussionThe reply of the discussion.

Example Call

curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
     -H "X-User-Id: aobEdbYhXfu5hkeqG" \
     -H "Content-Type: application/json" \
     http://localhost:3000/api/v1/rooms.createDiscussion  \
     -d '{ 
          "prid": "GENERAL", 
          "t_name": "Discussion Name"}'

Example Response

{
    "discussion": {
        "rid": "cgk88DHLHexwMaFWh",
        "name": "WJNEAM7W45wRYitHo",
        "fname": "Discussion Name",
        "t": "p",
        "msgs": 0,
        "usersCount": 0,
        "u": {
            "_id": "rocketchat.internal.admin.test",
            "username": "rocketchat.internal.admin.test"
        },
        "topic": "general",
        "prid": "GENERAL",
        "ts": "2019-04-03T01:35:32.271Z",
        "ro": false,
        "sysMes": true,
        "default": false,
        "_updatedAt": "2019-04-03T01:35:32.280Z",
        "_id": "cgk88DHLHexwMaFWh"
    },
    "success": true
}

Change Log

Version Description
1.0.0 Added