WhatsApp Send Messages

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.

Text Messages

Call the method SendMessageText and pass the following parameters:

 


oClient := TsgcWhatsApp_Client.Create(nil);
oClient.WhatsappOptions.PhoneNumberId := '107809351952205';
oClient.WhatsappOptions.Token := 'EAAO4OpgZAs98BAGj3nCFGr...ZB2t8mmLB2LRXJkte2Y5PMNh2';
oClient.SendMessageText('34605889421', 'Hello from sgcWebSockets!!!');

 

Image Messages

Call the method SendMessageImage and pass the following parameters:

 


oClient := TsgcWhatsApp_Client.Create(nil);
oClient.WhatsappOptions.PhoneNumberId := '107809351952205';
oClient.WhatsappOptions.Token := 'EAAO4OpgZAs98BAGj3nCFGr...ZB2t8mmLB2LRXJkte2Y5PMNh2';
oClient.SendMessageImage('34605889421', 'https://www.media.com/image.png', 'logo');

 

 

Document Messages

Call the method SendMessageDocument and pass the following parameters:

 

 


oClient := TsgcWhatsApp_Client.Create(nil);
oClient.WhatsappOptions.PhoneNumberId := '107809351952205';
oClient.WhatsappOptions.Token := 'EAAO4OpgZAs98BAGj3nCFGr...ZB2t8mmLB2LRXJkte2Y5PMNh2';
oClient.SendMessageDocument('34605889421', 'https://www.documents.com/file.txt', 'Document', 'file.txt');

 

Audio Messages

Call the method SendMessageAudio and pass the following parameters:

 

 


oClient := TsgcWhatsApp_Client.Create(nil);
oClient.WhatsappOptions.PhoneNumberId := '107809351952205';
oClient.WhatsappOptions.Token := 'EAAO4OpgZAs98BAGj3nCFGr...ZB2t8mmLB2LRXJkte2Y5PMNh2';
oClient.SendMessageAudio('34605889421', 'https://www.audio.com/audio.mp3');

 

Video Messages

Call the method SendMessageVideo and pass the following parameters:

 

 


oClient := TsgcWhatsApp_Client.Create(nil);
oClient.WhatsappOptions.PhoneNumberId := '107809351952205';
oClient.WhatsappOptions.Token := 'EAAO4OpgZAs98BAGj3nCFGr...ZB2t8mmLB2LRXJkte2Y5PMNh2';
oClient.SendMessageVideo('34605889421', 'https://www.video.com/audio.mp4');

 

Sticker Messages

Call the method SendMessageSticker and pass the following parameters:

 

 


oClient := TsgcWhatsApp_Client.Create(nil);
oClient.WhatsappOptions.PhoneNumberId := '107809351952205';
oClient.WhatsappOptions.Token := 'EAAO4OpgZAs98BAGj3nCFGr...ZB2t8mmLB2LRXJkte2Y5PMNh2';
oClient.SendMessageSticker('34605889421', 'https://www.stickers.com/sticker');

 

 

Location Messages

Call the method SendMessageLocation and pass the following parameters:

 

 


oClient := TsgcWhatsApp_Client.Create(nil);
oClient.WhatsappOptions.PhoneNumberId := '107809351952205';
oClient.WhatsappOptions.Token := 'EAAO4OpgZAs98BAGj3nCFGr...ZB2t8mmLB2LRXJkte2Y5PMNh2';
oClient.SendMessageLocation('34605889421', '50.159305', '9.762686', 'My Location', 'My Address');

 

Contact Messages

Call the method SendMessageContact and pass the following parameters:

 

 


oClient := TsgcWhatsApp_Client.Create(nil);
oClient.WhatsappOptions.PhoneNumberId := '107809351952205';
oClient.WhatsappOptions.Token := 'EAAO4OpgZAs98BAGj3nCFGr...ZB2t8mmLB2LRXJkte2Y5PMNh2';
oClient.SendMessageContact('34605889421', 'John Smith', '15550386570', 'john@mail.com');