wa_me.core package¶
Submodules¶
wa_me.core.client module¶
- class wa_me.core.client.Client(**kwargs)[source]¶
Bases:
object
Represents a client connection that connects to Whatsapp. This class is used to interact with the WhatsApp Business Cloud API.
Note
The Cloud API supports up to 80 messages per second (mps) combined sending and receiving of text and media messages by default, and up to 500 mps by request.
Note
Cloud API follows Business Use Case Rate Limits. Each WhatsApp Business Account (WABA) has a call count rate limit and each call made by your app counts toward the limit. An app’s call count for a WABA is the number of calls it can make to business accounts under this WABA during a rolling one hour window and is calculated as follows:
Calls within one hour for a WABA = 1800000 * Number of Registered Numbers under this WABA
You will receive an 80007 error code when you hit call limits.
wa_me.core.converter module¶
wa_me.core.errors module¶
- exception wa_me.core.errors.BadRequest(response: Response, content: Optional[Union[str, Dict[str, Any]]])[source]¶
Bases:
HTTPException
Exception that’s raised for when status code 400 occurs.
- exception wa_me.core.errors.Forbidden(response: Response, content: Optional[Union[str, Dict[str, Any]]])[source]¶
Bases:
HTTPException
Exception that’s raised for when status code 403 occurs.
- exception wa_me.core.errors.HTTPException(response: Response, content: Optional[Union[str, Dict[str, Any]]])[source]¶
Bases:
WaMeException
Exception that’s raised when an HTTP request operation fails.
Parameters¶
- response:
requests.Response
The response of the failed HTTP request. This is an instance of
requests.Response
.- content: Optional[Union[
str
, Dict[str
, Any]]] The content response of the failed HTTP request.
Attributes¶
- status:
int
The status code of the HTTP request.
- code:
int
The WhatsApp Business Cloud API specific error code for the failure.
- subcode:
int
The WhatsApp Business Cloud API specific error subcode for the failure.
- text: Optional[
str
] The text of the error. Could be an empty string.
- type: Optional[
str
] The type of the error. Could be an empty string.
- response:
- exception wa_me.core.errors.NotFound(response: Response, content: Optional[Union[str, Dict[str, Any]]])[source]¶
Bases:
HTTPException
Exception that’s raised for when status code 404 occurs.
- exception wa_me.core.errors.Unauthorized(response: Response, content: Optional[Union[str, Dict[str, Any]]])[source]¶
Bases:
HTTPException
Exception that’s raised for when status code 401 occurs.
- exception wa_me.core.errors.ValidationError[source]¶
Bases:
WaMeException
An Exception that is raised when there is a Validation Error.
- exception wa_me.core.errors.WhatsappServerError(response: Response, content: Optional[Union[str, Dict[str, Any]]])[source]¶
Bases:
HTTPException
Exception that’s raised for when a 500 range status code occurs.