Sending messages with line breaks and emojis via our API
In modern digital communication, conveying messages clearly and expressively is key. Alongside formatting text with line breaks for clarity, emojis are invaluable for adding emotion or emphasis. This guide shows how to include both line breaks and emojis in messages using our API, demonstrated through a simple JSON payload.
Crafting your Payload
To send a message that incorporates line breaks for structure and emojis for expression, structure your payload as follows:
{
"chatId": "<replace_me>",
"message": "Hello there! \n Good morning ☀️ \n How are you? 😊"
}
"chatId": "<replace_me>",
"message": "Hello there! \n Good morning ☀️ \n How are you? 😊"
}
- chatId: Substitute <replace_me> with the intended chat's ID.
- message: Utilize the
\n
sequence to insert line breaks. Directly add emojis into the message string as you would in a regular text message.
Essentials to Remember
- Line breaks are added using
\n
within your message string, ensuring text is easy to read and well-organized. - Emojis can be directly included in the message string. There's no need for special encoding; just insert the emoji as you would in any text message.
- Make sure your HTTP request headers are correctly set to include
Content-Type: application/json
and any required authentication credentials. - Consult our API documentation for detailed endpoint information and further guidance.
By embedding \n
for line breaks and directly inserting emojis into your JSON payload, you can send messages that are not only clear and structured but also expressive and engaging through our API.