chatengine-io / react-chat-engine

React component for a cheap and easy chat API
138 stars 35 forks source link

Send Messages Error Error: Request failed with status code 403 #105

Open mahdinet1 opened 2 years ago

mahdinet1 commented 2 years ago

i write this function and all of things are correct but i get 403 eror .why??

 const sendHandler = (e)=>{
    e.preventDefault()
    const messageObject = {'text': 'Hello world!'}
    const authObj = {'Project-ID':process.env.REACT_APP_PROJECT_ID, 'User-Name':process.env.REACT_APP_USER_NAME, 'User-Secret':process.env.REACT_APP_USER_SECRET}
   sendMessage(authObj,62006,messageObject,(data)=>console.log(data))

  }
alamorre commented 2 years ago

Hey 👋 Use this API call instead, the functions are now deprecated. Raw API calls are just better/inherently customizable

https://rest.chatengine.io/#35cf78ff-ee12-425c-bf95-8e5eb563b41f

Set the authObj in headers and messageObject in body and it'll definitely work!