API Documentation

Register

API Docs for Register.

POST /register/

Register a new user to the system.

{
    "username": "username",
    "name": "name",
    "email": "email@user.com",
    "mobile": "9999999999",
    "password": "password"
}
JSON Parameters:
 
  • username (str) – unique username
  • name (str) – name of the user
  • email (str) – unique email of user
  • mobile (str) – unique mobile number of user
  • password (str) – password of user
Status Codes:

Login

API Docs for Login.

POST /login/

Login a user to the system.

{
    "username": "username",
    "password": "my_secret_password",
}
JSON Parameters:
 
  • username (str) – unique username
  • password (str) – password of user
Status Codes:

Account

API Docs for Account.

GET /account/

Get a user.

{
    "id": 1,
    "username": "dummy_username",
    "name": "dummy_name",
    "email": "email@dummy.com",
    "mobile": "9999999999",
    "is_superuser": true,
    "is_staff": true
}
Status Codes:

PUT /account/

Update all details of user.

{
    "username": "updated_username",
    "name": "updated_name",
    "email": "email@updated.com",
    "mobile": "9999999999",
    "password": "updated_password"
}
JSON Parameters:
 
  • username (str) – unique username
  • name (str) – name of the user
  • email (str) – unique email of user
  • mobile (str) – unique mobile number of user
  • password (str) – password of user
Status Codes:

PATCH /account/

Update some details of user.

{
    "name": "partial_updated_name",
    "email": "email@partial_updated.com",
}
JSON Parameters:
 
  • username (str) – unique username, optional
  • name (str) – name of the user, optional
  • email (str) – unique email of user, optional
  • mobile (str) – unique mobile number of user, optional
  • password (str) – password of user, optional
Status Codes:

OTP

API Docs for OTP.

POST /otp/

Generate, validate and login using OTP.

{
    "destination": "1234567890",
    "email": "email@django.com",
    "verify_otp": "123456",
    "is_login": "True",
    "_comment1": "destination can be email/mobile",
    "_comment2": "when using mobile as destination, use email",
    "_comment3": "to verify otp, add verify_otp to request",
    "_comment4": "for log in, just add is_login to request",
}
JSON Parameters:
 
  • destination (str) – destination where otp to be sent
  • email (str) – if mobile is used in destination then use this for email, optional
  • verify_otp (str) – to verify otp, optional
  • is_login (str) – to login user, optional
Status Codes:

OTP Register Login

API Docs for OTP Register Login.

POST /otpreglogin/

Register, Login using OTP.

{
    "name": "some_awesome_name",
    "email": "email@django.com",
    "mobile": "1234567890",
    "verify_otp": "123456",
}
JSON Parameters:
 
  • name (str) – name of user
  • email (str) – email of user
  • mobile (str) – mobile of user
  • verify_otp (str) – to verify otp, optional
Status Codes:

Reset Password

API Docs for Reset Password.

POST /password/reset/

Reset user’s password.

  • To reset user’s password, first you have to call /otp/ with is_login parameter value false.
  • Then call this API
{
    "email": "email@django.com",
    "otp": "123456",
    "password": "my_new_secret_password",
}
JSON Parameters:
 
  • email (str) – email of user
  • otp (str) – otp received on email
  • password (str) – new password
Status Codes:

Is Unique

API Docs for Is Unique.

POST /isunique/

Check uniqueness of username, email, mobile.

{
    "prop": "email",
    "value": "email@django.com"
}
JSON Parameters:
 
  • prop (str) – property to check for uniqueness, choices are username, email, mobile
  • value (str) – value to check for uniqueness
Status Codes:

Upload Image

API Docs for Upload Image.

POST /uploadimage/

Upload user’s profile image.

{
    "profile_image": "<file_name>"
}
JSON Parameters:
 
  • profile_image (file) – image file
Status Codes: