Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

255
Vistas
How to make a post request to add users in chat room in react-chat-engine

I'm creating a chat app with react-chat-engine but I don't know how to make a post request to add users in chat room in react-chat-engine. I have referred this link- how to make a post request to create new users in react-chat-engine and now I want create new chat room in which I want to add members through post request.

I tried using POSTMAN but I cannot find a correct combination of the url the post request has to be sent to, headers and body. Some of the combinations I tried and the resulting errors are following:-

Method 1 Body

Method 1 Header

Method 2 Body

Method 2 Header

(I have removed the private key in screen shot)

Please help me out.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

How to create a new chat:

import axios from 'axios';

export const newChat = (title, projectId, username, secret, callback) => {
  axios
    .post(
        `https://api.chatengine.io/chats/`, 
        { title: title }, 
        { headers: { 
            "Public-Key": projectId, 
            "User-Name": username, 
            "User-Secret": secret 
        } }
    )

    .then((response) => {
      callback && callback(response.data);
    })

    .catch((e) => console.log('New Chat Error', e));
};

How to add a User to a chat:

import axios from 'axios';

export const invite: Invite = (chatId, inviteUsername, projectId, username, secret, callback) => {
  axios
    .post(
        `https://api.chatengine.io/chats/${chatId}/people/`, 
        { username: inviteUsername }, 
        { headers: { 
            "Public-Key": projectId, 
            "User-Name": username, 
            "User-Secret": secret 
        } }
    )

    .then((response) => {
      callback && callback(response.data);
    })

    .catch((e) => console.log('Invite Error', e));
};
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda