API Reference

Lavni all API routes which are used in the system are stated here. Basically API references are divided into 3 modules.

  • Authentication API routes
  • Therapist API routes
  • Client API routes
System has 2 basic user types.
  • Therapist
  • Client

Authentication API routes are public routes. Those can used to register as new therapist and client & all user types login requests.

Client API routes will be used when client is authenticated to the system. These routes work with only valid API Token. API token is created when client is logged in (Authentication). Client user type tokens are not eligible to access other routes.

Therapist API routes will be used when therapist is authenticated to the system. These routes work with only valid API Token. API token is created when therapist is logged in (Authentication). Therapist user type tokens are not eligible to access other routes.

Public API routes will be used for public api calls. These routes no need an API Token.

https://lavni-api.efito.xyz

Authentication

All authentication related API routes are explained here.

SignUp With Facebook - Therepist

Therapist user type can authenticate with Facebook.

POST /api/public/signUpWithFacebook
Request
{
  "accessToken" : "EytZBamZBw",
  "facebookId" : "1d5we",
  "medium": "FACEBOOK"
  "role": "THERAPIST"
}
Response
{
  "success": true,
  "data": "authToken",
  "message": "Successfully Registered."
}

SignUp With Facebook - Client

Client user type can authenticate with Facebook.

POST /api/public/signUpWithFacebookReact
Request
{
  "userData": {
    "accessToken": "EytZBamZBw",
    "medium": "FACEBOOK",
    "facebookId": "1d5we",
    "role": "CLIENT",
    "firstname": "John",
    "lastname": "Faruk",
    "gender": "Male",
    "dateOfBirth": "1996-10-20",
    "ethnicityId": "65b9bfb7ad5d1dc915d76585",
    "username": "john",
    "state": "Albama",
    "zipCode": "23244",
    "skip": true,
    },
  "primaryPhone": "+123456789",
}
Response
{
  "success": true,
  "data": "userData.authToken",
  "message": "Successfully Registered."
}

SignUp With Google - Therepist

Therapist user type can authenticate with Google.

POST /api/public/signUpWithGoogle
Request
{
  "idToken": {
    "credential": "EytZBamZBw",
    "clientId": "E334BaBwv4",
    },
  "role": "THERAPIST",
}
Response
{
  "success": true,
  "data": "data.authToken",
  "message": "Successfully Registered."
}

SignUp With Google - Client

Client user type can authenticate with Google.

POST /api/public/signUpWithFacebookReact
Request
{
  "userData": {
    "idToken": "EytZBamZBw",
    "clientId": "E334BaBwv4",
    "role": "CLIENT",
    "primaryPhone": "+123456788",
    "firstname": "John",
    "lastname": "Faruk",
    "gender": "Male",
    "dateOfBirth": "1996-10-20",
    "ethnicityId": "65b9bfb7ad5d1dc915d76585",
    "username": "john",
    "state": "Albama",
    "zipCode": "23244",
    "skip": true,
    }
  }
Response
{
  "success": true,
  "data": "userData.authToken",
  "message": "Successfully Registered."
}

SignUp Using Email - Therepist

Therapist user type can sign up using email.

POST /api/public/signUp
Request
{
  "email" : "therapist1@blondmail.com",
  "phone" : "+11111111111",
  "password": "Abc123"
  "role": "THERAPIST"
}
Response
{
  "success": true,
  "data": "user",
  "message": "Therapist Registered Successfully."
}

SignUp Using Email - Client

Client user type can sign up using email.

POST /api/public/registerWithEmail
Request
{
  "userData": {
    "firstname": "Haris",
    "lastname": "Vento",
    "email": "client1@blondmail.com",
    "username": "john",
    "dateOfBirth": "1996-10-20",
    "ethnicityId": "65b9bfb7ad5d1dc915d76585",
    "gender": "Male",
    "primaryPhone": "+123456789",
    "state": "Albama",
    "zipCode": "23244",
    "password": "Abc123",
    "role": "CLIENT",
    "skip": true,
   }
  }
Response
{
  "success": true,
  "data": "user",
  "message": "You have been registered successfully."
}

Login With Facebook

Both therapist & client user types can authenticate with Facebook.

POST /api/public/loginWithFacebook
Request
{
  "accessToken" : "gtrfdf45gf",
  "facebookId" : "1d5we",
  "medium": "FACEBOOK"
}
Response
{
  "success": true,
  "data": "token",
  "message": "Success"
}

Login With Google

Both therapist & client user types can authenticate with Google.

POST /api/public/loginWithGoogle
Request
{
  "idToken": {
    "credential": "EytZBamZBw",
    "clientId": "E334BaBwv4",
  }
}
Response
{
  "success": true,
  "data": "token",
  "message": "Success"
}

Login

Both therapist & client user types can log in to account..

POST /api/public/login
Request
{
  "email" : "email",
  "password" : "Abc123",
  "medium": "EMAIL"
}
Response
{
  "success": true,
  "data": "data",
  "message": "Successfully Logged."
}

Send OTP to Verify Email

Therapist user type must validate their emails when signup. They will receive confirm email to their email address & they can use OTP code to verify email.

POST /api/public/resendVerificationCode
Request
{
  "userId" : "6630d7792b93543ad0cb0725",
}
Response
{
  "success": true,
  "data": "user",
  "message": "Success"
}

Verify Therapist Login

Therapist user type must validate their login. They will receive confirm email to their email address and a SMS. Then they can use 6 digits OTP code to verify email.

POST /api/public/resendVerificationCode
Request
{
  "verificationCode" : "123456",
  "role" : "THERAPIST",
  "userId" : "6630d7792b93543ad0cb0725",
}
Response
{
  "success": true,
  "data": "token",
  "message": "Success"
}

Therapist Login Without Verification

Therapist user types can login without verification.

POST /api/public/TherapistLogin
Request
{
  "email" : "therapist1@blondmail.com",
  "password" : "Abc123",
  "medium" : "EMAIL",
}
Response
{
  "success": true,
  "data": "data",
  "message": "Successfully Logged."
}

Client Verification By Code

Client user type must validate their login. They will receive confirm email to their email address and a SMS. Then, they can use 6 digits OTP code to verify.

POST /api/public/verifyByCode
Request
{
  "verificationCode" : "123456",
  "userId" : "6630d7792b93543ad0cb0725",
}
Response
{
  "success": true,
  "data": "null",
  "message": "Successfully verified."
}

Forgot Password

Request to modify password.

POST /api/public/forgotPassword
Request
{
 "email": "client1@blondmail.com"
}
Response
{
 "success": true,
 "data": null,
 "message": "Email sent"
}

Reset Password

Set new password after verifying token.

POST /api/public/resetPassword
Request
Response

View User Profile

Therapist and client user types can view any profile.

GET /api/public/getUserByUserId/:id
Parameter
"id": "6698ba39622a291d966c7339"
Example: /api/public/getUserByUserId/6698ba39622a291d966c7339
Response
{
 "success": true,
 "data": data,
 "message": "Success"
}

View Approved Reviews

Can see all admin approved reviews.

GET /api/public/get-all-approved-lavni-reviews/:limit/:offset
Parameter
"limit": "20"
"offset": "0"
Example: /api/public/get-all-approved-lavni-reviews/20/0
Response
{
 "success": true,
 "data": data,
 "message": "Success"
}

View Therapist Limited Profile Details

Therapist and client user types can view any profile.

GET /api/public/getTherapistByUserIdLimited/:id
Parameter
"id": "6698b9c9622a291d966c7329"
Example: /api/public/getTherapistByUserIdLimited/6698ba39622a291d966c7339
Response
{
 "success": true,
 "data": data,
 "message": "Success"
}

Contact Us

Anyone can send a contact message. No need to login to account.

POST /api/public/contact-us
Request
{
  "name" : "David",
  "email" : "abc@blondmail.com",
  "problem" : "your text",
  "phoneNumber" : "+13453565674",
}
Response
{
  "success": true,
  "data": "data",
  "message": "Your contact message has been received. One of our agents will reach out to you soon."
}

Submit Rating For Lavni

Anyone can rate Lavni platform.

POST /api/public/submit-rating
Request
{
  "name" : "David",
  "email" : "abc@blondmail.com",
  "reviewMessage" : "your message here",
  "ratingValue" : "7",
}
Response
{
  "success": true,
  "data": "data",
  "message": "Thank You for your valuable review!"
}