Sending messages in the WhatsApp Business API. The /contacts method
WhatsApp has a huge base of potential customers, it is not surprising that many entrepreneurs seek access to the WhatsApp Business API as an official tool for conducting mailing. However, everything is not so simple here and there are several important nuances that you should keep in mind before connecting the number to WhatsApp Business API. Let's look at everything in order and find out how to properly send messages in the WhatsApp Business API.
To begin with, a small reminder, if you have connected the WhatsApp Business API, but you are having difficulties sending messages, then check yourself on it:
1 – Have the message templates been developed and approved?
2 – Has the user's consent been obtained?
3 - Did you check the number using the /contacts method before sending the message?
Also note that the WhatsApp Business API is a gateway for sending messages. By itself, the WhatsApp Business API does not allow you to send messages, for this you need to integrate it with any software solution-it can be your CRM\ERP system, chat bot or any other platform that has the necessary functionality.
Now in order
1. To initiate communication with clients (both incoming and outgoing), you must use template messages moderated by Facebook. You can create them in your personal account of the Chat API or in Facebook Business Manager. Learn more about how to work with templates and how to use them here.
After initiating communication with the client using template messages, you will be able to correspond with the user in a free format for 24 hours. After 24 hours, regular messages will not be sent and you need to use the templates again.
2. Facebook declares that the customers to whom you send messages must agree to receive newsletters. On our part, we recommend building communication with customers in such a way that they have the opportunity to express their consent and interest in communicating with you, as well as to refuse if they are not interested in your mailings.
If complaints are received about your messages, this may lead to a drop in the rating of the number. Read more about this here.
3. Checking the number using the /contacts method before sending the message. In a situation where the client wrote to you first, then you can easily send him a response template message to initiate communication. This is explained by the fact that the contact initiated by the client is a confirmation that the user is predisposed to communicate with you, so there is no need to carry out additional manipulations.
Everything becomes more complicated if you are going to send a newsletter to several numbers with which you have not previously interacted or interacted more than a week ago.
In this case, before sending messages, you must use the /contacts method. This method checks the number (verifies) indicates the ability to send messages and returns the status of the number along with the ID. Only after activating the /contacts method, it becomes possible to send a template message. Without this step, your messages will simply not be sent.
Now for more details
Send a POST request /v1/contacts, after which you will have the opportunity to enter the numbers of interest. It is better to determine the contact database in advance and send them in one request, since too frequent use of the /contacts method can lead to dissatisfaction with Facebook, but more on this below. You can enter numbers in any format, while Facebook advises you to specify numbers with a " + " and indicating the country and city code separated by spaces:
Next, the API will return you the ID of the number along with the statuses, there are four of them in total:
1 – "Valid" – everything is fine, the number is available for communication;
2 – "Processing" – the data is still being processed;
3 – "Invalid" - a number that is not available for communication;
4 – "Failed" – something went wrong.
Use the provided WhatsApp ID to send template emails.
- Facebook promises to ban WhatsApp Business API users who check numbers, but do not send messages. You use this method only for contacts to whom the mailing will be sent, and we also advise you to exercise reasonable caution in the number of numbers being checked.
- Facebook currently does not have the ability to notify about changes in the status of the number, so this method will have to be used on an ongoing basis. The numbers must be checked using the \contact method once every 7 days. If you skip this period, it will be impossible to send messages to the numbers.
The original article.