Package: waeasyapi
WA Easy API Python ClientPython bindings for interacting with the WA Easy APIWA Easy API allows you to send and receive messages using Official WhatsApp APIs.This is primarily meant for developers who wish to perform interactions with the WA Easy API programatically.Installation$pipinstallwaeasyapiUsageYou need to setup your key and secret using the following:
You can find your keys athttps://waeasyapi.com/.importwaeasyapiclient=waeasyapi.Client(auth=("<YOUR_ACC_ID>","<YOUR_ACC_SECRET>"))Usage - Messaging# number must start with the country's dialing code# example - For USA: 158883993# example - For India: 919876543210# example - send a text messageclient.message.sendTextMessage({"number":"188377783","message":"Hello world!"})# example - send an approved WhatsApp templateclient.message.sendTemplateMessage({"number":"188377783","template":"template-name","params":{"key1":"value1","key2":"value2"}})# example - send an image messageclient.message.sendImageMessage({"number":"188377783","params":{"link":"your_image_link"}})# example - send a video messageclient.message.sendVideoMessage({"number":"188377783","params":{"link":"your_video_link"}})# example - send an audio messageclient.message.sendAudioMessage({"number":"188377783","params":{"link":"your_audio_link"}})# example - send a voice messageclient.message.sendVoiceMessage({"number":"188377783","params":{"link":"your_voice_link"}})# example - send url messageclient.message.sendURLMessage({"number":"188377783","url":"https://example.com"})Usage - Template# eg - create and submit a WhatsApp template messageclient.template.createTemplate({"name":"template_name","category":"OTP","language":"en","components":[{"type":"HEADER","format":"TEXT","text":"I am header."},# format = TEXT | IMAGE | VIDEO | DOCUMENT{"type":"BODY","text":"I am body."},{"type":"FOOTER","text":"I am footer."},{"type":"BUTTONS","buttons":[# for quick reply buttons, type = QUICK_REPLY{"type":"PHONE_NUMBER","text":"Call Us","phone_number":"+18887777877"},{"type":"URL","text":"Visit Website","url":"https://waeasyapi.com"},]},]});# get all templatesclient.template.getTemplates();# templateName = name_of_the_templateclient.template.deleteTemplate(templateName);Usage - Profile# manage your WhatsApp Business Profile# example - get your WhatsApp profile photoclient.profile.getProfilePhoto();# example - get your WhatsApp profile aboutclient.profile.getProfileAbout();# example - get your WhatsApp business profileclient.profile.getBusinessProfile();# example - delete your WhatsApp business photoclient.profile.deleteProfilePhoto();# example - change your WhatsApp business photoclient.profile.changeProfilePhoto({"photo":"base64_string_of_image"});# example - change your WhatsApp profile aboutclient.profile.changeProfileAbout({"about":"Hey! I\'m using WA Easy API!"});# example - change your WhatsApp business profileclient.profile.changeBusinessProfile({"description":'Official WhatsApp Business APIs & Messaging Platform',"vertical":'Professional Services',"address":'California, USA',"email":'team@waeasyapi.com',"websites":['https://waeasyapi.com']});# acceptable business verticals are# const verticals = [#   'Automotive',#   'Beauty, Spa and Salon',#   'Clothing and Apparel',#   'Education',#   'Entertainment',#   'Event Planning and Service',#   'Finance and Banking',#   'Food and Grocery',#   'Public Service',#   'Hotel and Lodging',#   'Medical and Health',#   'Non-profit',#   'Professional Services',#   'Shopping and Retail',#   'Travel and Transportation',#   'Restaurant',#   'Other'# ]Usage - Media# eg - get your uploaded mediaclient.media.getMedia(mediaId);# eg - upload your media# send a post (`multipart/form-data`) request with the media on `file` key to# basic auth is acceptable with acc_id as username & acc_secret as passwordhttps://api.waeasyapi.com/v1/media/upload# acceptable content types# audio - audio/aac, audio/mp4, audio/amr, audio/mpeg, audio/ogg; codecs=opus# Note: The base audio/ogg type is not supported.# document - Any valid MIME-type.# image - image/jpeg, image/png# sticker - image/webp# video - video/mp4, video/3gpp# Note: Only H.264 video codec and AAC audio codec is supported.# Note: Only videos with a single audio stream are supported.App DetailsAfter setting up client, you can set your app details before making any request
to WA Easy API using the following:client.set_app_details({"title":"<YOUR_APP_TITLE>","version":"<YOUR_APP_VERSION>"})For example, you can set the title toDjangoand version to1.8.17. Please ensure
that both app title and version are strings.Bugs? Feature requests? Pull requests?All of those are welcome. You canfile issuesorsubmit pull requestsin this repository.