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.
Call the method SendMessageImage and pass the following parameters:
oClient := TsgcWhatsApp_Client.Create(nil); oClient.WhatsappOptions.PhoneNumberId := '107809351952205'; oClient.WhatsappOptions.Token := 'EAAO4OpgZAs98BAGj3nCFGr...ZB2t8mmLB2LRXJkte2Y5PMNh2'; oClient.SendFileImage('34605889421', 'c:\images\image.png', 'image/png');
Call the method SendMessageDocument and pass the following parameters:
oClient := TsgcWhatsApp_Client.Create(nil); oClient.WhatsappOptions.PhoneNumberId := '107809351952205'; oClient.WhatsappOptions.Token := 'EAAO4OpgZAs98BAGj3nCFGr...ZB2t8mmLB2LRXJkte2Y5PMNh2'; oClient.SendFileDocument('34605889421', 'c:\MyDocuments\invoice.pdf', 'application/pdf');
Call the method SendMessageAudio and pass the following parameters:
oClient := TsgcWhatsApp_Client.Create(nil); oClient.WhatsappOptions.PhoneNumberId := '107809351952205'; oClient.WhatsappOptions.Token := 'EAAO4OpgZAs98BAGj3nCFGr...ZB2t8mmLB2LRXJkte2Y5PMNh2'; oClient.SendFileAudio('34605889421', 'c:\Music\audio.mp3', 'audio/mp4');
Call the method SendMessageVideo and pass the following parameters:
oClient := TsgcWhatsApp_Client.Create(nil); oClient.WhatsappOptions.PhoneNumberId := '107809351952205'; oClient.WhatsappOptions.Token := 'EAAO4OpgZAs98BAGj3nCFGr...ZB2t8mmLB2LRXJkte2Y5PMNh2'; oClient.SendFileVideo('34605889421', 'c:\Videos\video.mp4', 'video/mp4');
Call the method SendMessageSticker and pass the following parameters:
oClient := TsgcWhatsApp_Client.Create(nil); oClient.WhatsappOptions.PhoneNumberId := '107809351952205'; oClient.WhatsappOptions.Token := 'EAAO4OpgZAs98BAGj3nCFGr...ZB2t8mmLB2LRXJkte2Y5PMNh2'; oClient.SendFileSticker('34605889421', 'c:\Stickers\MySicker.webp', 'image/webp');
When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.