Functions that define the features, parameters and content of the message.
A function that allows you to determine whether the recipient supports long text (depending on the recipient capabilities,
the length of the message may be limited or may involve additional costs, for example SMS).
Parameter |
Type |
Required |
Comment |
|
Boolean |
|
Return the long text support flag. |
A function that allows you to determine whether the recipient supports formatting. Formatting with <b>, <i> and <a> html tags is allowed.
A function that allows you to determine whether the recipient supports chat actions.
Parameter |
Type |
Required |
Comment |
|
Boolean |
|
Return the chat actions support flag. |
A function that allows you to determine whether the recipient supports file sending.
Parameter |
Type |
Required |
Comment |
|
Boolean |
|
Return the file sending support flag. |
A function that allows you to determine whether the recipient supports images.
Parameter |
Type |
Required |
Comment |
|
Boolean |
|
Return the images support flag. |
Set the message title (by default, the message title is set based on the name of the source that generated this message).
Parameter |
Type |
Required |
Comment |
title |
String |
Yes |
New message title. |
Returns the previously set message title.
Parameter |
Type |
Required |
Comment |
|
String |
|
Returns the message title. |
Set the message priority (by default, the priority value is set to "Medium").
Parameter |
Type |
Required |
Comment |
title |
String |
Yes |
New message priority. Allowed values: highest, high, normal, low, lowest. |
|
Boolean |
|
Return the "priority is set" flag. |
Returns the previously set message priority.
Parameter |
Type |
Required |
Comment |
|
String |
|
Returns the message priority. |
Set the message level (by default, the level value is set to "Info").
Parameter |
Type |
Required |
Comment |
title |
String |
Yes |
New message level. Allowed values: verbose, info, notice, warning, error, success. |
|
Boolean |
|
Return the "level is set" flag. |
Returns the previously set message level.
Parameter |
Type |
Required |
Comment |
|
String |
|
Returns the message level. |
Actions are buttons that appears under the message and allow the user to take some action directly from the chat.
If the recipient does not support actions, then they will be sent using simple links (if the corresponding functionality was provided by the source developer).
An external service can produce a reaction to an action either using a direct call to the url specified for this action, or by requesting the message status on its own.
Adding an action button. If during of an action creation a callback url was specified, then this url will be called in the background when the action is activated.
Parameter |
Type |
Required |
Comment |
name |
String |
Yes |
The action internal name for the identification. |
title |
String |
Yes |
The displayed for user action name. |
callback |
String |
|
Url called in the background when the action is activated. |
|
Boolean |
|
Return the "action added successfully" flag. |
Adding an action as a link. Source developer should place the link to message by himself. If during of an action creation a callback url was specified, then this url will be called in the background when the action is activated.
Parameter |
Type |
Required |
Comment |
name |
String |
Yes |
The action internal name for the identification. |
title |
String |
Yes |
The displayed for user action name. |
callback |
String |
|
Url called in the background when the action is activated. |
|
String | Null |
|
Returns the action link if action added successfully. |
Adding a file to the message.
Parameter |
Type |
Required |
Comment |
file |
File |
Yes |
The File you get from the Request model by functions: files, filesByField, filesByName. |
name |
String |
|
File name. By default, it will be set from the File structure (file.name). |
mime_type |
String |
|
File MIME-type. By default, it will be set from the File structure (file.mime_type). |
|
Boolean |
|
Returns the "file added successfully" flag. |
Adding a file to the message from the content.
Parameter |
Type |
Required |
Comment |
content |
String |
Yes |
File content. |
name |
String |
|
File name. |
mime_type |
String |
|
File MIME-type. |
|
Boolean |
|
Returns the "file added successfully" flag. |
Adding a file to the message by the link.
Parameter |
Type |
Required |
Comment |
url |
String |
Yes |
File link. |
name |
String |
|
File name. |
mime_type |
String |
|
File MIME-type. |
|
Boolean |
|
Returns the "file added successfully" flag. |
Adding an image to the message.
Parameter |
Type |
Required |
Comment |
file |
File |
Yes |
The File you get from the Request model by functions: files, filesByField, filesByName. |
name |
String |
|
File name. By default, it will be set from the File structure (file.name). |
mime_type |
String |
|
File MIME-type. By default, it will be set from the File structure (file.mime_type). |
|
Boolean |
|
Returns the "image added successfully" flag. |
Adding an image to the message from the content.
Parameter |
Type |
Required |
Comment |
content |
String |
Yes |
File content. |
name |
String |
|
File name. |
mime_type |
String |
|
File MIME-type. |
|
Boolean |
|
Returns the "image added successfully" flag. |
Adding an image to the message by the link.
Parameter |
Type |
Required |
Comment |
url |
String |
Yes |
File link. |
name |
String |
|
File name. |
mime_type |
String |
|
File MIME-type. |
|
Boolean |
|
Returns the "image added successfully" flag. |
You must use one of the functions: addFileLink, addFileLinkFromContent, addFileLinkFromUrl to organize a file link.
All of these functions return a TplFile structure.
The TplFile structure contains the following fields:
Parameter |
Type |
Comment |
name |
String |
File name. |
url |
String |
File link. |
Adding a file link to the message.
Parameter |
Type |
Required |
Comment |
file |
File |
Yes |
The File you get from the Request model by functions: files, filesByField, filesByName. |
name |
String |
|
File name. By default, it will be set from the File structure (file.name). |
mime_type |
String |
|
File MIME-type. By default, it will be set from the File structure (file.mime_type). |
|
TplFile | Null |
|
Returns the file in case of success. |
Adding a file link to the message from content.
Parameter |
Type |
Required |
Comment |
content |
String |
Yes |
File content. |
name |
String |
|
File name. |
mime_type |
String |
|
File MIME-type. |
|
TplFile | Null |
|
Returns the file in case of success. |
Adding a file link to the message by the link.
Parameter |
Type |
Required |
Comment |
url |
String |
Yes |
File link. |
name |
String |
|
File name. |
mime_type |
String |
|
File MIME-type. |
|
TplFile | Null |
|
Returns the file in case of success. |