WhatsApp Send Files

All API calls must be authenticated with an Acccess Token.  Developers can authenticate their API calls with the access token generated in App Dashboard > WhatsApp > Getting Started

 

The API calls return the Message Id as a string.

 

When you send a File using the WhatsApp API, first the message is uploaded to WhatsApp servers and then a new message is sent with the object id returned after upload the file.

Image Messages

Call the method SendMessageImage and pass the following parameters:

 


TsgcWhatsapp_Client oClient = new TsgcWhatsapp_Client();
oClient->WhatsappOptions->PhoneNumberId = "107809351952205";
oClient->WhatsappOptions->Token = "EAAO4OpgZAs98BAGj3nCFGr...ZB2t8mmLB2LRXJkte2Y5PMNh2";
oClient->SendFileImage("34605889421", "c:\images\image.png", "image/png");

 

 

Document Messages

Call the method SendMessageDocument and pass the following parameters:

 

 


TsgcWhatsapp_Client oClient = new TsgcWhatsapp_Client();
oClient->WhatsappOptions->PhoneNumberId = "107809351952205";
oClient->WhatsappOptions->Token = "EAAO4OpgZAs98BAGj3nCFGr...ZB2t8mmLB2LRXJkte2Y5PMNh2";
oClient->SendFileDocument("34605889421", "c:\MyDocuments\invoice.pdf", "application/pdf");

 

Audio Messages

Call the method SendMessageAudio and pass the following parameters:

 

 


TsgcWhatsapp_Client oClient = new TsgcWhatsapp_Client();
oClient->WhatsappOptions->PhoneNumberId = "107809351952205";
oClient->WhatsappOptions->Token = "EAAO4OpgZAs98BAGj3nCFGr...ZB2t8mmLB2LRXJkte2Y5PMNh2";
oClient->SendFileAudio("34605889421", "c:\Music\audio.mp3", "audio/mp4");

 

Video Messages

Call the method SendMessageVideo and pass the following parameters:

 

 


TsgcWhatsapp_Client oClient = new TsgcWhatsapp_Client();
oClient->WhatsappOptions->PhoneNumberId = "107809351952205";
oClient->WhatsappOptions->Token = "EAAO4OpgZAs98BAGj3nCFGr...ZB2t8mmLB2LRXJkte2Y5PMNh2";
oClient->SendFileVideo("34605889421", "c:\Videos\video.mp4", "video/mp4");

 

Sticker Messages

Call the method SendMessageSticker and pass the following parameters:

 

 


TsgcWhatsapp_Client oClient = new TsgcWhatsapp_Client();
oClient->WhatsappOptions->PhoneNumberId = "107809351952205";
oClient->WhatsappOptions->Token = "EAAO4OpgZAs98BAGj3nCFGr...ZB2t8mmLB2LRXJkte2Y5PMNh2";
oClient->SendFileSticker("34605889421", "c:\Stickers\MySicker.webp", "image/webp");