From 23528d98d92b1c23a8a5dfa6e0615cb4ce1edb07 Mon Sep 17 00:00:00 2001 From: kevenwallace_ Date: Sun, 11 Jun 2023 04:21:40 -0300 Subject: [PATCH] Add WHATSAPP Methods --- pysendpulse/pysendpulse.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pysendpulse/pysendpulse.py b/pysendpulse/pysendpulse.py index 8660d10..69d8812 100644 --- a/pysendpulse/pysendpulse.py +++ b/pysendpulse/pysendpulse.py @@ -1210,3 +1210,29 @@ def send_event(self, event_name, body): return self.__handle_error('Seems you not pass body') return self.__handle_result(self.__send_request('/events/name/{}'.format(event_name, ), 'POST', body)) + + # ------------------------------------------------------------------ # + # WHATSAPP # + # ------------------------------------------------------------------ # + + def get_bots(self): + """ Get_bots + + @return: dictionary with response message + """ + return self.__handle_result(self.__send_request('whatsapp/bots', 'GET')) + + def get_templates(self, bot_id): + """ Get_templates + + @param bot_id: string bot_id + @return: dictionary with response message + """ + + if not bot_id: + return self.__handle_error('Seems you not pass bot_id') + + return self.__handle_result(self.__send_request('whatsapp/templates?bot_id={}'.format(bot_id), 'GET')) + + + \ No newline at end of file