![]() ![]() String phoneNumber = "REPLACE_WITH_YOUR_PHONE_NUMBER" +international_country_code + phone number The above copyright notice and this permission notice shall be included in allĬopies or substantial portions of the Software.Ĭonst char* ssid = "REPLACE_WITH_YOUR_SSID" Ĭonst char* password = "REPLACE_WITH_YOUR_PASSWORD" Of this software and associated documentation files. Permission is hereby granted, free of charge, to any person obtaining a copy After understanding how it works, the idea is to incorporate it into your own projects. This is a simple example to show you how to send messages. The following example code sends a message to your WhatsApp account when the ESP32 first boots. Sending Messages to WhatsApp – ESP32 Code Go to Sketch > Include Library > Manage Libraries and search for URLEncode library by Masayuki Sugahara as shown below. We’ll use the UrlEncode library that can be installed on your Arduino IDE. You can encode the message yourself, or you can use a library, which is much simpler. You can learn more about URL encoding here. This will allow us to include characters like ç, ª, º, à, ü in our messages. URLs can only be sent over the Internet using the ASCII character-set. URL encoding converts characters into a format that can be transmitted over the Internet. : the API key you received during the activation process in the previous section.įor the official documentation, you can check the following link: Installing the URLEncode LibraryĪs we’ve seen previously, the message to be sent needs to be URL encoded.: the message to be sent, should be URL encoded.: phone number associated with your WhatsApp account in international format.To send a message using the CallMeBot API you need to make a POST request to the following URL (but using your information): &text= &apikey= The WhatsApp message from the bot will contain the API key needed to send messages using the API CallMeBot API Note: If you don’t receive the API key in 2 minutes, please try again after 24hs. Wait until you receive the message “ API Activated for your phone number.Send the following message: “ I allow callmebot to send me messages” to the new Contact created (using WhatsApp of course).Add the phone number +34 644 51 95 23 to your Phone Contacts.Follow the next instructions ( check this link for the instructions on the official website). ![]() Getting the CallMeBot API KEYīefore starting using the API, you need to get the CallmeBot WhatsApp API key. This can be useful to send alert messages from the ESP32.Īll the information about how to send messages using the API, can be found here. ![]() You can learn more about CallMeBot at the following link:īasically, it works as a gateway that allows you to send a message to yourself. To send messages to your WhatsApp account with the ESP32, we’ll use a free API service called CallMeBot service. Install WhatsApp on your smartphone if you don’t have it already. WhatsApp is free and is available for Android and iOS. “WhatsApp Messenger, or simply WhatsApp, is an internationally available American freeware, cross-platform centralized instant messaging and voice-over-IP service owned by Meta Platforms.” It allows you to send messages using your phone’s internet connection, so you can avoid SMS fees. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |