Client for Arkesel OTP API.
When using arkesel, annoyingly you have to have two balances:
- one for sms
- one for the otp account
This is a wrapper around the Arkesel SMS API to use your sms balance to send OTP codes instead of maintaining two balances.
- Clone this repository using Git
- Navigate into the project directory:
cd arkesel-otp-python-client - Install dependencies using pip:
pip install -r requirements.txt - Add your arkesel api key to the
.env. example in .envexample file - Run the client:
python app.py
- You can now use this service to handle the entire OTP workflow without needing an API layer see example
- Generate an OTP
curl -X POST "http://localhost:8000/generate-otp" \
-H "Content-Type: application/json" \
-d '{"phone_number": "233200000000"}'- Validate the OTP using the id we generated in step one.
curl -X POST "http://localhost:8000/validate-otp" \
-H "Content-Type: application/json" \
-d '{"id": "25d27781-a482-4d46-96e2-4e27c69f595b", "code": "1A2B3C"}'
- Check OTP Status using the id we generated in step one.
curl -X POST "http://localhost:8000/get-otp-status" \
-H "Content-Type: application/json" \
-d '{"id": "25d27781-a482-4d46-96e2-4e27c69f595b"}'