Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

254
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!