whatsapie/__init__.py
Whatsapie
Whatsapp Cloud API manager class, this class handles the functions of making httpx to Meta's cloud api.
Source code in whatsapie/__init__.py
__init__(access_token, phone_number_id, log=False)
Initializes the whatsapie manager class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
access_token |
str
|
Meta's Whatsapp Cloud API user specific access token. |
required |
phone_number_id |
str
|
Meta's Whatsapp Cloud API user specific phone number ID. |
required |
Source code in whatsapie/__init__.py
inspect_schema(message, pretty_print=True)
Invoke this method from an instance to inspect the api schema of this message
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message |
Message
|
Must be a type of Message Instance supports Text, Location, Media |
required |
Source code in whatsapie/__init__.py
send(message)
async
Invoke this method from an instance to send a whatsapp message
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message |
Message
|
Must be a type of Message Instance supports Text, Location, Media |
required |
Returns:
Type | Description |
---|---|
A bool status of the performed api call |
Raises:
Type | Description |
---|---|
ErrorResponse
|
If the Cloud API returns and error response |