Notice: Undefined offset: 1 in /home/freudservi/domains/freud-servis.ru/public_html/classes/modules/stat/classes/libs/detect.php on line 394
How to send pictures, files and text messages using messengers Business API help.chat-api.com

How to send pictures, files and text messages using messengers Business API

To start a conversation with a user in a messenger using the messengers Business API, it is necessary to open a 24-hour dialog box for communication with the client. To do this, it is enough to send a template message to the client and wait for a response from him. Since template messages are crucial part vital the beginning of communication, we will analyze in more detail the types of template messages, how to create them, at what point you can send files with them, and how you can simplify this active part by using our «quick templates».

Very briefly. What are template messages?

Template messages are the first messages you send to the client to open a dialogue with him. All template messages are checked by Comp, which is carried out automatically, you need to create your template.

Now Comp coordinates almost all template messages, except for e whose content contradicts Comp's trade policy. Templates cannot be edited after their approval, but you can create a new one if something in the template no longer suits you.

How do I create a template message?

MESAPI documentation. A template message can be created using the /add Template method of our MESAPI documentation. At the same time, it is essential to observe the ratio of parameters, if you specify that the language of the message is EN, then the content of the template message should be in English,  if the message contains buttons, then do not forget to form the appropriate information for them, for example, the Url, if it is a Call To Action button. We talked about the controls in detail here. You can learn more about the conditions for forming template messages in this article.

Message template constructors. You can create a template message through the built-in constructors in the Chat API and Comp Business Manager personal account. To do this, add a new template to the Chat API personal account:

 Specify the necessary parameters and attach the necessary files

 In Comp Business Manager, the order is similar:

info

Important! In template messages, you can attach media files and documents in advance. At the same time, sending audio messages via MESAPI is not available today. The files can be related to the media format (MIME type) - pdf, CSV, SQL, doc, etc.

Comp will also check the contents of attachments, so when creating a template, you need to attach examples of the files being sent. Let's reveal a small life hack – the only thing that Comp does not check when creating a template are variables {1},{2},{3} ..., which, after approval, can be any. Our "Quick Messages" are based partly on the mechanics of variables.

 Quick Messages or Universal template from the Chat API

Since it is essential for the Chat API team to provide a comfortable and convenient approach to working with the messengers Business API, we have developed a simple way for our clients to create and send template messages – it is enough to use the /SendMessage function.

Quick messages are an alternative to template messages for those who do not want to waste time creating them. When you send text messages outside the 24-hour dialog box, we automatically turn them into templates using pre-approved variables.

Quick messages are a very convenient tool that allows you to send the necessary messages to customers without additional waiting and unnecessary actions. Still, quick messages, at least for now, have several limitations that need to be taken into account:

info

1 – With the help of quick messages, you can send text, but to send files, it is better to use the template builder or send files as links. After opening the dialog, you can use the /SendFile function;

2 – Template messages have limits on the number of lines, so far, there are 7, but we will expand them soon;

3 – Quick statements are not available immediately after registration of the number; it should take 4 hours to a day for quick notes to be uploaded to your account.

Quick messages also allow you to bypass the need to work with the /contacts method, which we'll talk about below.

How do I send template messages?

After you have created a template message and it has been agreed with Comp, you can start sending it, but before that, you need to perform one more meaningful action. This is a number verification using the /contacts method

Thus, Comp restricts users from excessive mailings and downloads, you should check the number of the intended sending by the contact method and get a response that the user is available to receive messages. We wrote about it in great detail here.

info

It is better to determine the contact database in advance and send them in one request since frequent use of the /contacts method leads to a temporary restriction of sending the request.

You can check the contact using this method, through our testing tools, or directly using the documentation; if you receive a Valid response, you can start sending.

Quick messages and method /contacts

As we have already written, we need to ensure comfortable and uninterrupted work with the messenger; therefore, if you use /SendMessage to open a dialog, then we will automatically use /contacts to check the number; that is, you do not need to worry about checking connections before sending, we will do it for you.

How do I send files with the first message?

It's simple, for this, you can use the template builder and create your unique template with the necessary files. Files can be "sewn" directly into the template or set as variables in the form of links.

Using our documentation, you can also create a template with files via the API itself.

To send files with the first message, using our "Quick Templates,” you need to send the file with a link.

After opening the dialog box, you can send files in regular messages.

Write to us if you have any questions about working with messengers Business API , we will be happy to help you. You can find out all the latest news on the work of the service in our telegram channel.

Was this article helpful?

Your opinion will be used to improve the content of the article

The Most Multifunctional API Provider

Chat API has been operating since 2015 and is one of the first and largest providers in Eastern Europe.

Here are some curious and important figures:

  • We have tremendous expertise in docker container management at scale with an SLA of 99.5+%;
  • Chat API involves in its work more than 200 servers, with the ability to quickly connect another 100;
  • 3200 cores and 25 terabytes of RAM;
  • 200+ methods and features that keep adding;
  • Highload system, Up Time servers 99.9%;
  • Support 24\7;
Get access to the API