Skip to main content
Version: 3.0.0

💬 Send a message

Send a message to the specified phone number

var res = await whatsapp.sendMessage(
phoneNumber : 'PHONE_NUMBER',
text : 'text_message',
previewUrl : true,
);

if(res.isSuccess()){
print(res.getMessageId()); // wamid.HBgMOTE3MDIzMDQyMzA2FQIAERgSRkVCRTM5Q0UwQUIyOTE4NTEzAA==
} else {
print('HTTP: $res.getHttpCode()'); // 400
print('API Error: $res.getErrorMessage()'); // Phone Number is not valid
}
Return Methods

Please find out supported return method here. That return method can be used in all methods.

paramtyperequireddescription
phoneNumberstringyesPhone number with county code and plus.
textstringyesA text message to send
previewUrlboolnoUrl preview in message if there is any link