average-microphone-34472
03/07/2025, 10:44 AMif (existingConversation) {
const temp = await this.botpressService.client.getConversation({
id: existingConversation.botpress_conversation_id,
});
conversation = temp.conversation;
} else {
const temp =
await this.botpressService.client.createConversation({});
conversation = temp.conversation;
// Store the new conversation in the database
await this.prisma.botpress_twilio_id_map.create({
data: {
botpress_conversation_id: conversation.id,
twilio_whatsapp_id: body.WaId,
is_active: 1,
},
});
}
// send user's message to botpress
const createdMsg = await this.botpressService.client.createMessage({
conversationId: conversation.id,
payload: {
type: body.MessageType,
text: body.Body,
imageUrl: body.MessageType === 'image' ? mediaUrl : '',
videoUrl: body.MessageType === 'video' ? mediaUrl : '',
audioUrl: body.MessageType === 'audio' ? mediaUrl : '',
},
});
I am using Botpress API in this way
but when I already have the record for a particular user in the DB, then I again go for chat with Bot, It shows me:
ForbiddenError: You are not a participant in this message's conversation
Am I doign something wrong here?