Open juanele121976 opened 3 days ago
/////////////////code //////////////
export const sendWhatsAppUpdateState = asyncHandler(async (req: any, res: any, next: any) => {
const phone_number_to_send = req.body.phone
const mensaje = req.body.message
console.log(mensaje,phone_number_to_send)
const wp = new WhatsappAPI({
accountPhoneNumberId: PHONE_NUMBER_KEY || "", // required
accessToken: WHATSAPP_TOKEN_KEY || "", // required
})
const returned = await wp.sendTextMessage(phone_number_to_send, {message:mensaje,preview_url:false});
res.status(200).json({
success: true,
response:returned,
// total,
});
});
Hello, thank you for your contribution to send WhatsApp messages, I have a problem, sending the message everything comes out ok, but WhatsApp does not receive anything
"response": { "messaging_product": "whatsapp", "contacts": [ { "input": "+56996958468", "wa_id": "56996958468" } ], "messages": [ { "id": "wamid.HBgLNTY5OTY5NTg0NjgVAgARGBI5QzVBODg1OERGMTUwRDRFAATQ" } ] }
thanks a lot