Files
Global-Jain/resources/docs/1.0/overview.md
2025-11-05 10:37:10 +05:30

8.0 KiB

API Docs

Login

Details for login api

####Endpoint

{warning} Please note that the URI for this endpoint should include api/{$version} before

| Method | URI | Headers | | : | :- | : | | POST | /login | Default |

URL Params

None

Data Params

{
    "email" : "4513098763",
    "via" : "PASSWORD", // PASSWORD / OTP
    "password" :"abcdefgh",
    "verified" : "1",
    "app_version" : "1",
}

{success} Success Response

####Code 200 ####Content

{
    "type": 1, //1: E-mail 2: Contact number
    "email": "test.user@global.jain",
    "country_code": "-",
    "mobile": "-",
    "email_preview": "t********@g*****.jain",
    "message": "Please check your phone for OTP."
}

{danger} Unauthenticated Response

####Code 401 ####Content

{
    "message": "This contact does not exist!"
}

Login via Facebook

Details for Login via Facebook api

####Endpoint

{warning} Please note that the URI for this endpoint only should not include api/{$version} before

| Method | URI | Headers | | : | :- | : | | POST | /social-login | Default |

URL Params

None

Data Params

{
    "email":"test@globaljain.com",
    "id":"12345",
    "provider":"facebook",
    "name":"GJ Test"
}

{success} Success Response

####Code 200 ####Content

{
    "token": "3|kUpw8msHyXbND275RNIv2KlyBnQE7ltECWRO3Flc",
    "user": {
        "id": 3,
        "name": "GJ Test",
        "email": "test@globaljain.com",
        "country_code": null,
        "mobile": null,
        "email_preview": "t***@g*********.com",
        "avatar_url": null,
        "is_profile_verified": null,
        "login_type": 1,
        "unread_message_count": null,
        "unread_notification_count": null
    },
    "message": "Logged in succesfully.",
    "status": 200
}

{danger} Unauthenticated Response

####Code 403 ####Content

{
    "message": "Something went wrong!",
    "status": 403
}

Register

Details for Registration api

####Endpoint

{warning} Please note that the URI for this endpoint should include api/{$version} before

| Method | URI | Headers | | : | :- | : | | POST | /register | Default |

URL Params

None

Data Params

{
    "name" : "Test User",
    "email" : "4513098763",
    "country_code" : "91",
    "dharma" : 2, //Dharma ID
    "birth_date" : "1999/01/11",
    "password" : "abcdefgh",
    "password_confirmation" : "abcdefgh"
}

{success} Success Response

####Code 200 ####Content

{
    "user": {
        "id": 2,
        "name": "Test User",
        "email": "test.user@global.jain",
        "country_code": null,
        "mobile": null,
        "email_preview": "t********@g*****.jain",
        "avatar_url": null,
        "is_profile_verified": null,
        "login_type": 0, //0: Normal, 1: Social Media
        "unread_message_count": null,
        "unread_notification_count": null
    },
    "message": "Check your mobile number for otp and verify."
}

{danger} Unauthenticated Response

####Code 400 ####Content

{
    "message": "This contact already exists!"
}

Reset Password

Details for Reset Password api

####Endpoint

{warning} Please note that the URI for this endpoint should include api/{$version} before

| Method | URI | Headers | | : | :- | : | | POST | /user/reset/password | Default |

URL Params

None

Data Params

{
    "current_password" : "abcdefgh",
    "new_password" : "12345678",
    "confirm_password" : "12345678"
}

{success} Success Response

####Code 200 ####Content

{
    "status": 200,
    "success": true,
    "message": "Password has been updated"
}

{danger} Unauthenticated Response

####Code 400 ####Content

{
    "message": "The given data was invalid.",
    "errors": {
        "new_password": [
            "The new password and confirm password must match."
        ]
    }
}

Set Password

Details for Reset Password api

####Endpoint

{warning} Please note that the URI for this endpoint should include api/{$version} before

| Method | URI | Headers | | : | :- | : | | POST | /set/password | Default |

URL Params

None

Data Params

{
    "country_code" : "+91",
    "mobile" : "9632587410",
    "new_password" : "abcdefgh",
    "confirm_password" : "abcdefgha"
}

{success} Success Response

####Code 200 ####Content

{
    "status": 200,
    "success": true,
    "message": "Password has been updated"
}

Email verification

Details for Email verification through OTP api

####Endpoint

{warning} Please note that the URI for this endpoint should include api/{$version} before

| Method | URI | Headers | | : | :- | : | | POST | /email-verification | Default |

URL Params

None

Data Params

{
    "otp": "151545",
    "email": "test.user@global.jain"
}

{success} Success Response

####Code 200 ####Content

{
    "token": "1|ZqTjAV0RipnxnFiVEdgrGjSxzublx8SEQ12WeRUj",
    "user": {
        "id": 2,
        "name": "Test User",
        "email": "test.user@global.jain",
        "country_code": null,
        "mobile": null,
        "email_preview": "t********@g*****.jain",
        "avatar_url": null,
        "is_profile_verified": null,
        "login_type": 0, //0: Normal, 1: Social Media
        "unread_message_count": null,
        "unread_notification_count": null
    },
    "message": "OTP code has been verified.",
    "success": true
}

{danger} Unauthenticated Response

####Code 403 ####Content

{
    "message": "Please provide a valid OTP code.",
    "success": false
}

Logout

Details for logout api

####Endpoint

{warning} Please note that the URI for this endpoint should include api/{$version} before

| Method | URI | Headers | | : | :- | : | | GET | /user/logout | Bearer {token} |

URL Params

None

Data Params

None

{success} Success Response

####Code 200 ####Content

{
    "message": "Logged out."
}

{danger} Unauthenticated Response

####Code 404 ####Content

{
    "message": "User not found."
}

User Exist

Details for user-exist api

####Endpoint

{warning} Please note that the URI for this endpoint should include api/{$version} before

| Method | URI | Headers | | : | :- | : | | POST | /user/exist | |

URL Params

None

Data Params

{
    "country_code" : "+91"
    "mobile" : "9426596321"
}

{success} Success Response

####Code 200 ####Content

{
    "status": 200,
    "success": true
}

Delete Shravak Account Details

Details of delete shravak profile details

####Endpoint

{warning} Please note that the URI for this endpoint should include api/{$version} before

| Method | URI | Headers | | : | :- | : | | POST | user/delete-account | Bearer {token} |

URL Params

None

Data Params

None

{success} Success Response

####Code 200 ####Content

{
    "message": "Account deleted successfully.",
    "status": 200
}

{danger} Unauthenticated Response

####Code 403 ####Content

{
    "message": "You can\'t delete this account, Please add or update the sangh admin in which you are associated!",
    "status": 403
}