Creates a new user by providing a valid email
.
Returns a new userId
in the body and Location
header.
{
"email": "[email protected]"
}
{
"userId": "3419e0d7-ff9b-4a99-a3f4-b567fdff3a2b"
}
curl -d '{"email": "[email protected]"}' \
-H "Content-Type: application/json" \
-X POST http://localhost:8080/v1/users
Creates a new otp for a given userId
.
Returns a new 6 digit otp
and expiration metadata.
{
"userId": "3419e0d7-ff9b-4a99-a3f4-b567fdff3a2b"
}
{
"userId": "3419e0d7-ff9b-4a99-a3f4-b567fdff3a2b",
"otp": "988569",
"expiration": {
"expiresIn": 30,
"measurementUnit": "Seconds"
},
"creationTime": "2024-08-22T19:42:09.522528Z"
}
curl -d '{"userId": "3419e0d7-ff9b-4a99-a3f4-b567fdff3a2b"}' \
-H "Content-Type: application/json" \
-X POST http://localhost:8080/v1/otp
Verify status of otp
for a given userId
.
Returns the otp status
.
{
"userId": "3419e0d7-ff9b-4a99-a3f4-b567fdff3a2b",
"otp": "988569"
}
{
"userId": "3419e0d7-ff9b-4a99-a3f4-b567fdff3a2b",
"otp": "988569",
"otpStatus": "ACCEPTED",
"timestamp": "2024-08-22T19:42:37.077639Z"
}
curl -d '{"userId": "3419e0d7-ff9b-4a99-a3f4-b567fdff3a2b", "otp": "988569"}' \
-H "Content-Type: application/json" \
-X POST http://localhost:8080/v1/verifications
On Mac, with colima
you need to create a symlink for testcontainers to work
sudo ln -s $HOME/.colima/docker.sock /var/run/docker.sock
You need to bind a valid mongoDB connection string to variable $DB_URI