Facebook Whatsapp Business Account Manager
Handle some facebook whatsapp business account manager functionalities.
FYI: waba stands for WhatsApp Business Account
Usage
Constructor
from fb_waba_manager import FbWabaManager
access_token = 'my_access_token'
business_id = 'my_business_id'
fwm = FbWabaManager(access_token, business_id)
Methods
The following methods are provided:
All methods accept the notify_request parameter, if the given value is True
the method will always return the requested data and a bool indicating if a new request was made to the GraphAPI.
Ps.: All methods are generators.
list_business_wabas
Retrieve a list of all waba objects of your business
| notify_requests | bool (optional) |
for w in fwm.list_business_wabas():
print(w)
list_waba_phone_numbers
Retrieve a list of all phone number objects of your waba
| waba_id | str |
| notify_requests | bool (optional) |
waba_id = '1231434'
for pn in fwm.list_waba_phone_numbers(waba_id):
print(pn)
list_business_phone_numbers
Retrieve a list of all phone number objects of all wabas of your business
| wabas | list (optional) |
| notify_requests | bool (optional) |
for pn in fwm.list_business_phone_numbers():
print(pn)
my_wabas = [
{
'id': '12342443'
},
{
'id': '56355465'
}
]
for pn in fwm.list_business_phone_numbers(my_wabas):
print(pn)
list_message_templates
Retrieve a list of all message templates objects of your waba
| waba_id | str |
| notify_requests | bool (optional) |
waba_id = '1231434'
for mt in fwm.list_message_templates(waba_id):
print(mt)
Reference
The waba, business, phone number and message template definition or properties can be found at Facebook's oficial documentation