SendLocationMessage Method
Definition:
The SendLocationMessage
method is used to share a specific location with users. This method sends a message containing latitude, longitude, location name, and address information.
Usage:
SendLocationMessage(double lat, double lon, string name, string address);
Parameters:
- lat (double): Latitude of the location to be sent.
- lon (double): Longitude of the location to be sent.
- name (string): Name of the location (e.g., “Office”).
- address (string): Address of the location.
Example Usage:
// Sending a specific location to the user
SendLocationMessage(40.987654, 29.123456, “QSoft Office”, “Istanbul, Turkey”);
Description:
This method facilitates location sharing within WhatsApp using specified coordinates and address details.
SendLocationRequest Method
Definition:
The SendLocationRequest
method is used to request a location from the user. It sends a message asking the user to share their current location.
Usage:
this.Messages.SendLocationRequest(“Please send your location”);
Parameters:
- message (string): Message to be sent to the user. Example: “Please share your location.”
Example Usage:
// Requesting the user’s current location
this.Messages.SendLocationRequest(“Please share your location.”);
Description:
This method is used to request the user’s current location via WhatsApp.
SendContact Method
Definition:
The SendContact
method is used to send a contact card to the user. This method sends a contact card containing phone number, name, surname, email, company, department, and title.
Usage:
SendContact(string phoneNumber, string name, string surname, string email, string company, string department, string title);
Parameters:
- phoneNumber (string): Phone number of the contact.
- name (string): First name of the contact.
- surname (string): Last name of the contact.
- email (string): Email address of the contact.
- company (string): Company name of the contact.
- department (string): Department of the contact.
- title (string): Job title of the contact.
Example Usage:
// Sending a contact card to the user
SendContact(“+905001112233”, “Ahmet”, “Yılmaz”, “ahmet.yilmaz@example.com”, “QSoft”, “Software”, “Engineer”);
Description:
This method is used to share a contact card via WhatsApp.
SendSticker Method
Definition:
The SendSticker
method is used to send a sticker to the user. The sticker must be in the correct format and size.
Usage:
SendSticker(string stickerUrl);
Parameters:
- stickerUrl (string): URL of the sticker to be sent.
Example Usage:
// Sending a sticker to the user
SendSticker(“https://example.com/sticker.webp”);
Notes:
- A static sticker should be 512×512 pixels and must not exceed 100 KB.
- An animated sticker should be 512×512 pixels and must not exceed 500 KB.
- The sticker must be in WebP format.
- All EXIF and metadata must be removed.
- If you have a PNG or JPEG file, you can convert it to WebP format using [[CloudConvert](https://cloudconvert.com/)].
SendEmoji Method
Definition:
The SendEmoji
method is used to send or remove an emoji reaction to a message.
Usage:
SendEmoji(string messageId, string emoji);
Parameters:
- messageId (string): ID of the message to react to.
- emoji (string): Emoji character to be sent.
Example Usage:
// Adding an emoji reaction to a message SendEmoji(“1234567890”, “😊”); // Removing a previously sent emoji SendEmoji(“1234567890”, “”);
Notes:
- All emojis supported by Android and iOS are available.
- Processed emojis are supported.
- If using Unicode values, they must be escaped correctly for Java or JavaScript.
- Only one emoji can be sent in a reaction message.
- Use an empty string to remove a previously sent emoji.
SendCatalog Method
Definition:
The SendCatalog
method is used to send a message displaying products from the linked catalog.
Usage:
SendCatalog(string message, string footer);
Parameters:
- message (string): Catalog message to be sent to the user.
- footer (string): Footer text of the message.
Example Usage:
// Sending a catalog message to the user
SendCatalog(“Discover our products!”, “Contact us for more information.”);
Description:
This method sends a message allowing the user to view the catalog of linked products via WhatsApp.
SendProductMessage Method
Definition:
The SendProductMessage
method is used to send product information from the Meta catalog.
Usage:
this.Messages.SendProductMessage(“1”);
Parameters:
- id (string): Unique ID of the product in the Meta catalog.
Example Usage:
// Sending product information to the user
this.Messages.SendProductMessage(“1”);
Description:
This method is used to share details of a product listed in the catalog.
Note:
The product must first be added to the Meta catalog before sending its details.
SendMultipleProductMessage Method
Definition:
The SendMultipleProductMessage
method is used to send multiple product details in a single message from the Meta catalog.
Usage:
SendMultipleProductMessage(string bodyText, string footerText, string headerText, List products);
Example Usage:
var products = new List
{
new MultiProductSection
{
Title = “Group 1”,
Items = new List
{
new MultiProductItem { ProductRetailerId = “12345” },
new MultiProductItem { ProductRetailerId = “67890” }
}
}
};
this.Messages.SendMultipleProductMessage(“Body text”, “Footer text”, “Header text”, products);