Endpoints

POST requests take place via JSON requests. A typical usage would look like

curl -H "Content-Type: application/json" [-H "Authorization: Bearer JWT"] --request POST  -d '<json-request>'  http://localhost:8080/<endpoint>
# or if using get
curl [-H "Authorization: Bearer JWT"] --request GET http://localhost:8080/<endpoint>

Signup

  • /signup/otp : POST
{ "name": "<name>", "roll": "<rollno>", "email": "<emailid>" }
  • /signup : POST
{
  "name": "<name>",
  "roll": "<rollno>",
  "email": "<emailid>",
  "password": "<password>",
  "otp": "<otp>",
  "batch": "<batch>"
}

Login

  • /login : POST
{ "roll": "<rollno>", "password": "<password>" }
  • /secretpage : GET
curl -H "Authorization: Bearer $JWT" --request GET http://localhost:8080/secretpage

Auth Header needed in all endpoints below this

User's Info

  • /user/info : GET
curl -H "Authorization: Bearer $JWT" --request GET http://localhost:8080/user/info
  • /user/reward : GET
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
{ "roll": "<rollno>", "email": "<emailid>" }
  • /forgotpass : POST
{ "roll": "<rollno>", "password": "<password>", "otp": "<otp>" }

Rewards

  • /reward : POST Only GenSec and AH
{ "roll": "<rollno>", "coins": "<coins>" }

Transfer

  • /transfer/otp : GET
curl -H "Authorization: Bearer $JWT" --request GET http://localhost:8080/transfer/otp
  • /transfer : POST
{ "roll": "<rollno>", "coins": "<coins>", "otp": "<otp>" }

Store

  • /store/list : GET
curl --request GET http://localhost:8080/store/list
  • /store/add : POST Only GenSec and AH
{ "name": "<itemname>", "value": "<itemvalue>" }
  • /store/remove : POST Only GenSec and AH
{ "itemNo": "<itemno>" }

Redeem

  • /redeem/request/otp : GET
curl -H "Authorization: Bearer $JWT" --request GET http://localhost:8080/redeem/request/otp
  • /redeem/request : POST
{ "itemNo": "<itemno>", "otp": "<otp>" }
  • /redeem/list : GET Only GenSec and AH
curl -H "Authorization: Bearer $JWT" --request GET http://localhost:8080//redeem/list
  • /redeem/approve : POST Only GenSec and AH
{ "redeemid": "<redeemid>" }
  • /redeem/reject : POST Only GenSec and AH
{ "redeemid": "<redeemid>" }