I’m trying to send a message to a wix chat box through the backend. The code is very simple:
import wixChatBackend from ‘wix-chat-backend’ ;
export function get_message(request) {
const result = wixChatBackend.sendMessage({
“messageText” : “test” ,
“channelId” : “c0354ece-4cdf-38c1-98bf-48680EDITED” ,
“sendAsVisitor” : “false”
}).then(() => {
console.log( “Done sending message” );
})
. catch ((err) => {
console.log(err);
});
…
The code is defined in http-functions.js as I’m trying to post messages from another chat application to wix chat. It never works, isFulfilled is always false, isRejected is false as well. I go the channelId from the console on the client side. It seems like the API is just not working as I can’t see what could be the problem here.
Can anyone please help me? I’ve been working on this for days. Thank you!