Package: whatsapp-cloud-api
whatsapp-cloud-apiWhatsApp Cloud API Python ModuleThewhatsapp-cloud-apiPython module provides a simple and convenient way to interact with WhatsApp Cloud API. This module allows you to send various types of messages, including text messages, images, audio, videos, documents, and media messages. It abstracts away the complexity of the API calls and provides easy-to-use methods for sending different types of messages to WhatsApp users.InstallationYou can install thewhatsapp-cloud-apimodule using pip:pipinstallwhatsapp-cloud-apiUsageTo use thewhatsapp-cloud-apimodule, you need to import it into your Python script and create an instance of theWhatsAppclass by providing the required parameters:phone_number_idandbearer_token.fromwhatsapp_cloud_apiimportWhatsAppphone_number_id="your_phone_number_id"bearer_token="your_bearer_token"whatsapp=WhatsApp(phone_number_id,bearer_token)Sending Text MessagesYou can send text messages to WhatsApp users using thesend_text_messagemethod.to="recipient_phone_number"message="Hello, this is a text message."response=whatsapp.send_text_message(to,message)print(response.json())Sending ImagesYou can send images to WhatsApp users using thesend_image_messagemethod.to="recipient_phone_number"image_id_or_url="image_id_or_url"response=whatsapp.send_image_message(to,image_id_or_url)print(response.json())Sending AudioYou can send audio messages to WhatsApp users using thesend_audio_messagemethod.to="recipient_phone_number"audio_id_or_url="audio_id_or_url"response=whatsapp.send_audio_message(to,audio_id_or_url)print(response.json())Sending VideosYou can send videos to WhatsApp users using thesend_video_messagemethod.to="recipient_phone_number"video_id_or_url="video_id_or_url"response=whatsapp.send_video_message(to,video_id_or_url)print(response.json())Sending DocumentsYou can send documents to WhatsApp users using thesend_document_messagemethod.to="recipient_phone_number"document_id_or_url="document_id_or_url"response=whatsapp.send_document_message(to,document_id_or_url)print(response.json())Sending Media MessagesYou can send media messages (such as images, audio, videos, and documents) to WhatsApp users using thesend_media_messagemethod.to="recipient_phone_number"media_type="image"# Replace with the desired media typemedia_id_or_url="media_id_or_url"response=whatsapp.send_media_message(to,media_type,media_id_or_url)print(response.json())Sending ReactionsYou can send reactions to specific messages using thesend_react_to_messagemethod.to="recipient_phone_number"reply_to_message_id="message_id"emoji="👍"# Replace with the desired emojiresponse=whatsapp.send_react_to_message(to,reply_to_message_id,emoji)print(response.json())ContributingIf you'd like to contribute to the development of this module or report issues, please feel free to submit a pull request or create an issue on theGitHub repository.LicenseThis module is released under theMIT License.DisclaimerThis module is not officially affiliated with WhatsApp or Facebook. It's an independent project developed by the community.Note:Make sure to replace placeholders (your_phone_number_id,your_bearer_token, etc.) with actual values when using the module.For more detailed information about the methods and classes provided by thewhatsapp-cloud-apimodule, refer to the module's source code or docstrings.