The Send Message Process
  • 20 Nov 2023
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

The Send Message Process

  • Dark
    Light
  • PDF

Article Summary

The Send Message Process

This process is responsible for sending messages to users. It receives text templates, attachments, and argument values to compose them together dynamically into a single ready-for-sending message. Also, it does message localization.

send_message

Description of outcoming message parameters of the Send Message process

ParameterTypeRequiredDescription
channelstring+A name of a messenger from which a user wrote
chat_idstring+A unique identifier of a user in a messenger
text_idstring+A name of a text object to be sent to a user. The Localization state diagram stores the texts.
attachment_idstring+A name of an object which describes an attachment to a text message. The Attachments state diagram stores the attachments
itemsarrayOnly for Dynamic attachmentAn array of objects for dynamic attachment. The objects are inserted as parameters arguments into a message attachment to be shown as a carousel or keyboard to a user
currentPageintegerOnly for Dynamic attachmentEach messenger limits the maximum quantity of items shown in a carousel or keyboard. If an items array has more objects than allowed, this array is divided into pages (pagination). By default, the initial page number equals 1.

Input JSON Example

{
	"channel": "viber",
	"chat_id": "12345...",
	"text_id": "main_text",
	"attachment_id": "main_keyboard"
}

Input JSON Example (Dynamic attachment)

{
    "channel": "viber",
    "chat_id": "12345...",
    "text_id": "exchange_rates",
    "attachment_id": "carousel_pattern",
    "items": [{
            "name": "AED",
            "value": 4.283634
        },
        {
            "name": "AFN",
            "value": 85.711652
        },
        {
            "name": "ALL",
            "value": 126.118624
        },
        ...
        "currentPage": 1
    }