Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaungmyathan22/golang-sms-service
SMS otp verification service written in golang.
https://github.com/kaungmyathan22/golang-sms-service
gin golang twilio
Last synced: about 2 months ago
JSON representation
SMS otp verification service written in golang.
- Host: GitHub
- URL: https://github.com/kaungmyathan22/golang-sms-service
- Owner: kaungmyathan22
- Created: 2024-02-28T16:33:40.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-02-28T17:14:59.000Z (10 months ago)
- Last Synced: 2024-02-28T19:34:10.877Z (10 months ago)
- Topics: gin, golang, twilio
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SMS otp verification service.
## API Documentation
---
### Send OTPSend a POST request to the /otp endpoint with the following body to send an OTP to a user's phone number
POST /otp
Request Body
```json
{
"phoneNumber": ""
}
``````bash
curl -H "Content-Type: application/json" -X POST -d '{"phoneNumber": "+917420840576"}' http://localhost:8000/otp
```_Be sure to include the country code in the phone number_
Response
```json
{
"status": 202,
"message": "success",
"data": "OTP sent successfully"
}
```
---
### Verify OTPVerify a user's OTP by sending a POST request to the /verify endpoint with the following body that contains the phone number and the OTP code received by the user
POST /verifyOTP
Request Body
```json
{
"user": {
"phoneNumber": ""
},
"code": ""
}
``````bash
curl -H "Content-Type: application/json" -X POST -d '{"user": {"phoneNumber": "+917420840576"}, "code":"795279"}' http://localhost:8000/verifyOTP
```Response
```json
{
"status": 202,
"message": "success",
"data": "OTP verified successfully"
}
```
---