Code Monkey home page Code Monkey logo

Comments (1)

luth31 avatar luth31 commented on May 23, 2024 3

This route supports 2 methods: PUT to create a DM group and add users to it and DELETE to remove users from it (only the owner can do it)

In order to create a DM group, 3 users are required: the one that sends the PUT request, a primary and a secondary user (their order doesn't really matter)

To create the group DM channel:
The soon-to-be owner must send a PUT request to /channels/primary_user.dm_channel.id/recipients/secondary_user.id, if succesful this will return 201 and a json object with the following structure

{
   icon: null
   id: group_dm_channel.id
   last_message_id: // id of the last message in group dm channel, usually default "Owner added User1 and User2"
   name: null
   owner_id: // user id of owner
   recipients: [ 
      PublicUser(primary_user),
      PublicUser(secondary_user),
   ]
   type: 3 (channel type for group DM)
}

To further add new users:
participant must send a PUT request to /channels/group_dm_channel.id/recipients/invited_user.id, if succesful this will return 204 and nothing else.

To remove a participant:
owner must send a DELETE request to /channels/group_dm_channel.id/recipients/removed_user.id, if succesful this will return 204 and nothing else.

from server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.