The OTP Generation and SMS Sending API is a simple service that generates a one-time password (OTP) and sends it to a specified phone number via Twilio's trial SMS service. This API is designed to be easy to use and integrate into your applications to enable secure authentication and verification processes.
To use this API, you need the following:
- Internet connection to make API requests.
- An understanding of JSON data format.
No installation is required as this API is hosted on a remote server. You can start using the API by making HTTP requests as described in the next section.
The base URL for the API is: https://otpserver-5k5n.onrender.com/api/sendOTP
The request should include a JSON object containing the phoneNumber with the country code (e.g., "+1" for the United States):
{
"phoneNumber": "+1234567890"
}The API will respond with a JSON object containing the following fields:
status: A boolean indicating whether the OTP was successfully generated and sent.otp: The generated one-time password (numeric code).msg: A message providing additional information about the response status.
Example response:
{
"status": true,
"otp": "682951",
"msg": "OTP successfully sent via SMS."
}In case of errors, the API will respond with an appropriate HTTP status code and an error message in the response body.
Example error response:
{
"status": false,
"msg": "Invalid phone number format."
}To prevent abuse, the API enforces rate limiting. You can make a maximum of N requests per minute. If you exceed the rate limit, you will receive a 429 Too Many Requests response.
Contributions to this API are welcome! If you find any issues or want to improve the code, feel free to submit a pull request.
This project is licensed under the MIT License.
Feel free to contact us at kishanmishra389@gmail.com if you have any questions or need assistance using the API. We hope you find this API helpful for adding OTP functionality and SMS verification to your applications!