Answer the question
In order to leave comments, you need to log in
How to get data from input to send to whatsapp messages via ajax?
There is a script that sends a message to whatsapp
<script>
$( document ).ready(function() {
// URL для запроса POST /message
var url = 'https://eu43.chat-api.com/instance**********/message?token=**********';
var data = {
phone: '7**********', // Телефон получателя
body: 'Здесь должно быть сообщение', // Сообщение
};
// Отправим запрос при нажатии на кнопку
$( ".button" ).click(function() {
$.ajax(url, {
data : JSON.stringify(data),
contentType : 'application/json',
type : 'POST'
});
});
});
</script>
<input name="name" class="t-input">
<input name="phone" class="t-input">
<input name="address" class="t-input">
<input type="hidden" name="recipient" value="7**********"> //Номер телефона получателя информации о заказе в whatsapp
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question