Endpoints Usage example
Signup
/signup/otp
:POST
Input and output:
curl -X POST 'localhost:8080/signup/otp' -H 'Content-Type: application/json' \
-d '{
"name": "aska",
"roll": 200070,
"email": "aska20@iitk.ac.in",
"batch": 20,
}'
{
"error": "",
"message": "email Sent"
}
/signup
:POST
Input and output:
curl -X POST 'localhost:8080/signup' -H 'Content-Type: application/json' \
-d '{
"name": "aska",
"roll": 200070,
"email": "aska20@iitk.ac.in",
"password": "bird123",
"batch": 20,
"otp":"SaxCgCVJI7"
}'
{
"error": "",
"message": "User aska with roll 200070 is created"
}
Login
/login
:POST
Input and output:
curl -X POST 'localhost:8080/login' -H 'Content-Type: application/json' \
-d '{
"roll":200070,
"password":"bird123"
}'
{
"error": "",
"message": "Hey, User aska! Your roll is 200070. This JWT Token Valid for next 12 Hours",
"jwttoken": $JWT
}
/secretpage
:GET
Input and output:
curl -H "Authorization: Bearer $JWT" --request GET http://localhost:8080/secretpage
{
"error": "",
"message": "Welcome 200070! You have successfully accessed this secretpage!"
}
User's Info
/user/info
:GET
Input and output:
curl -H "Authorization: Bearer $JWT" --request GET http://localhost:8080/user/info
{
"message": "Wallet Money is: 0.000000",
"data": {
"roll": 200070,
"name": "Aska",
"email": "aska20@iitk.ac.in",
"password": "",
"batch": 20,
"usrtype": 0,
"otp": ""
}
}
and so on for other endpoints.
/user/reward
:GET
Input:
curl -H "Authorization: Bearer $JWT" --request GET http://localhost:8080/user/reward
/user/transaction
:GET
curl -H "Authorization: Bearer $JWT" --request GET http://localhost:8080/user/transaction
/user/redeem
:GET
curl -H "Authorization: Bearer $JWT" --request GET http://localhost:8080/user/redeem
Reset Password
/forgotpass/otp
:POST
Input and output:
curl -X POST 'localhost:8080/forgotpass/otp' \
-H 'Content-Type: application/json' \
-d '{
"roll":200070,
"email":"aska20@iitk.ac.in"
}'
{
"error": "",
"message": "email Sent"
}
/forgotpass
:POST
Input and output:
curl -X POST 'localhost:8080/forgotpass' \
-H 'Content-Type: application/json' \
-d '{
"roll":200070,
"email":"aska20@iitk.ac.in",
"password":"bird123",
"otp":"Z3R5BLJ9cz"
}'
{
"error": "",
"message": "Password reset succesful"
}
and so on for other endpoints.