V
V
Vladimir2020-11-25 00:07:41
API
Vladimir, 2020-11-25 00:07:41

How to make a form for VK API message.send method?

There is a link like this:

https://api.vk.com/method/messages.send?chat_id=2&message=СООБЩЕНИЕ&v=5.80&access_token=ТОКЕН ГРУППЫ


What is the best way to make an HTML or JS form in which you enter a message, press the button and it is sent by the bot to the conversation. It is necessary that the script simply substitute the message from the form in message= and send it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alekssamos, 2020-11-25
@lipskoy48

<form action="https://api.vk.com/method/messages.send" method="GET" target="frameresult">
<input type="hidden" name="chat_id" value="2">
<input type="hidden" name="v" value="5.80">
<input type="hidden" name="access_token" value="ТОКЕН ГРУППЫ">
<label for="message">Сообщение:</label><br>
<textarea name="message" id="message" style="max-width:300px; max-height:200px;"></textarea>
<div style="text-align:center;">
<button type="submit">Отправить</button>
</div>
</form>
<iframe name="frameresult"></iframe>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question