Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

256
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda