Sending all types of files to WhatsApp via the Chat API
We will tell you how you can send text, video, audio messages, send files, as well as electronic business cards, links and much more to WhatsApp via the Chat API.
1-Sending text messages
To send text messages, use the \SendMessage function.
Sometimes some of the messages may be lost when sending. In this case, pay attention to the quality of the Internet connection. Such situations may be associated with a loss of connection to the network.
To send files, you can use the \sendFile function.
You can send it as a link by converting the file to base64 using our converter, and you can also download and upload the file in the form field.
Sending a video
To send files, use only the https://link
You are given 10 seconds to upload a file to the server, if during this time the file did not have time to download, it will not be sent or an error will occur. The maximum file size is 60 MB.
It is better to send large files with a link, and not in base64.
You can enable the video reception function in your personal account in the "Account Settings" section.
It is also possible to enable video reception through the documentation. Use the group of methods : /settings.
and a request in JSON:"videoUploadOn":true
3-Sending audio messages
To send audio messages, you need to use the /sendPTT function.
At the same time, please note that WhatsApp accepts audio messages only in the format .ogg with the Oris codec
There is a very effective way to send voice messages:
1-Send a voice message to WhatsApp.
2-Download it from the link from /messages.
3-Send the received file.
To send links, you should use the \sendLink function
At the same time, when sending links to users with whom you communicate for the first time, the links may be blocked by WhatsApp anti-spam mechanisms. In order for the links to become active again, the user must add your contact to the notebook and continue communicating with you.
You can get acquainted with the functions of sending electronic business cards, geolocation, and forwarding messages in our documentation.