From sgcWebSockets 2022.7.0, now you can upload local files (like pdf, videos, audios...) to WhatsApp Servers and send a message to your users. Previously to this improvement, you can only send files to users that were uploaded previously to a public website.
Image Messages
Call the method SendMessageImage and pass the following parameters:
- aTo: phone number
- aFileName: full filename (with path) of the image file to send.
- aFileType:
- image/jpeg
- image/png
- aCaption: title of the image (optional).
Document Messages
Call the method SendMessageDocument and pass the following parameters:
- aTo: phone number
- aFileName: full filename (with path) of the document file to send.
- aFileType:
- text/plain
- application/pdf
- application/vnd.ms-powerpoint
- application/msword
- application/vnd.ms-excel
- application/vnd.openxmlformats-officedocument.wordprocessingml.document
- application/vnd.openxmlformats-officedocument.presentationml.presentation
- application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
- aCaption: title of the document (optional).
Audio Messages
Call the method SendMessageAudio and pass the following parameters:
- aTo: phone number
- aFileName: full filename (with path) of the audio file to send.
- aFileType:
- audio/aac
- audio/mp4
- audio/mpeg
- audio/amr
- audio/ogg
Video Messages
Call the method SendMessageVideo and pass the following parameters:
- aTo: phone number
- aFileName: full filename (with path) of the video file to send.
- aFileType:
- video/mp4
- video/3gp
Sticker Messages
Call the method SendMessageSticker and pass the following parameters:
- aTo: phone number
- aFileName: full filename (with path) of the sticker file to send.
- aFileType:
- image/webp