Add features to pysmsboxnet¶
To implement a new API feature, add a new method which will call the following private method:
- async pysmsboxnet.api.Client.__smsbox_request(self, uri: str, parameters: dict[str, str]) str ¶
Private method to send a request to the API.
- Parameters:
uri (str) – the host API endpoint, for example api.php or 1.1/api.php
parameters (dict) – parameters to pass to the API
- Returns:
SMSBox API response
- Return type:
str
- Raises:
pysmsboxnet.exceptions.HTTPException – if HTTP status is not 200 OK
pysmsboxnet.exceptions.SMSBoxException – SMSBox API returned ERROR
pysmsboxnet.exceptions.ParameterErrorException – bad parameters were passed to the API
pysmsboxnet.exceptions.AuthException – bad API key has been specified
pysmsboxnet.exceptions.BillingException – there are no enough credits to send the SMS
pysmsboxnet.exceptions.WrongRecipientException – recipient format is wrong
pysmsboxnet.exceptions.InternalErrorException – SMSBox API internal error
If an exception is needed, put it in pysmsboxnet/exceptions.py and make it extend pysmsboxnet.exceptions.SMSBoxException
.