After some googling I've found this useful link: https://blog.cloudrail.com/whatsapp-api-how-to-use-the-whatsapp-chat-api/
Basically it says:
At the moment, there is no official WhatsApp API to use. There are
some libraries available which use an unofficial API to send and
receive messages, but this is only limited to a single number. All
those libraries are basically hacks which try to act like a standard
WhatsApp client which you see on Android or iOS in combination with
WhatsApp Web. Nevertheless, there is one official offering by
WhatsApp: the Click to Chat API, which is basically only a link containing a target number and a prefilled text. Once a user clicks on this link, the WhatsApp client (Android, iOS, Web, etc) opens with a new message to the prefilled number with the prefilled text. This is a cool way to add a fast contact option for example if you want to sell your car. (see this link for more about 'WhatsApp Click To Chat': https://faq.whatsapp.com/en/android/26000030/?category=5245251).
If you want to play around with messaging platforms to build chatbots or other systems, have a look at Facebook Messenger, Telegram, Viber, Slack or Line.
Hope this helps
Update 19.05.2022: Meta just anounced a public API for businesses of any size. I will update this answer as soon as there are more infos about this.
Source: https://www.facebook.com/4/posts/10114482926371251/