Add features to pysmsboxnet¶
To implement a new API feature, add a new method that calls the following private method:
- async pysmsboxnet.api.Client.__smsbox_request(self, uri: str, parameters: dict[str, str]) str ¶
Send a request to the API (internal helper).
- Parameters:
uri (str) – the API path, for example
api.php
or1.1/api.php
parameters (dict) – form parameters to pass to the API
- Returns:
SMSBox API response
- Return type:
str
- Raises:
pysmsboxnet.exceptions.HTTPException – HTTP status is not 200 OK
pysmsboxnet.exceptions.SMSBoxException – API returned
ERROR
pysmsboxnet.exceptions.ParameterErrorException – invalid or missing parameters
pysmsboxnet.exceptions.AuthException – bad API key specified
pysmsboxnet.exceptions.BillingException – not enough credits to send the SMS
pysmsboxnet.exceptions.WrongRecipientException – recipient format is wrong
pysmsboxnet.exceptions.InternalErrorException – API internal error
If an exception is needed, place it in pysmsboxnet/exceptions.py
and have it extend pysmsboxnet.exceptions.SMSBoxException
.