Authentication/Profile
Authentication token will be expired at every day morning 6 a.m. due to exchange compliance.
Login through API
This API authenticates the user and creates a session for the user in the Host System. The session is identified by an alphanumeric login key in the response.
Method | POST |
Production URL | https://openapi.motilaloswal.com/rest/login/v3/authdirectapi |
Test URL | https://uatopenapi.motilaloswal.com/rest/login/v3/authdirectapi |
Request | JSON |
Response | JSON |
Request JSON
Field | Type | Mandatory | Description |
---|---|---|---|
Userid | String(15) | Y | Login Id |
Password | String(64) | Y | SHA-256(Password + APIKey). |
2FA | String(15) | N | DOB (dd/mm/yyyy) or PAN Card Mandatory in case of Investor client |
totp | String(6) | N | Authenticator 6 digit Code |
Ex . Password = abc and APIKey = 123
SHA-256(Password + APIKey) = SHA-256(abc123)
Sample Request (Body)
-
TOTP
{ "userid":"AA017", "password" :"23812bd4c1f3e980d86a16260b307d4a38dd6079577c9e9a22e9ccb75fcd59eb", "2FA":"18/10/1988", "totp": "Authenticator 6 digit Code" }
-
OTP
{ "userid":"AA017", "password" :"23812bd4c1f3e980d86a16260b307d4a38dd6079577c9e9a22e9ccb75fcd59eb", "2FA":"18/10/1988" }
Note -
TOTP – Send the 6 digit OTP on login using any Authenticator App.
OR
OTP – do not pass the otp parameter or pass it as blank.
Sample Response
{
"status": "SUCCESS",
"message": "Return Auth Token SUCCESS",
"errorcode": "",
"AuthToken": "774aac4a0a8846cc865d7df05c095b13_M",
"isAuthTokenVerified": "TRUE"
}
The AuthToken returned in response is Authorization Token used in header of each API.
Resend OTP
Method | POST |
Production URL | https://openapi.motilaloswal.com/rest/login/v3/resendotp |
Test URL | https://uatopenapi.motilaloswal.com/rest/login/v3/resendotp |
Request | None |
Response | JSON |
Sample Response
(You Will receive an OTP at your mobile and Email)
{
“status": "SUCCESS",
"message": "OTP SEND SUCCESSFULLY",
"errorcode": ""
}
Verify OTP
Method | POST |
Production URL | https://openapi.motilaloswal.com/rest/login/v3/verifyotp |
Test URL | https://uatopenapi.motilaloswal.com/rest/login/v3/verifyotp |
Request | JSON |
Response | JSON |
Request JSON
Field | Type | Mandatory | Description |
---|---|---|---|
otp | Number(6) | Y | 6 digit Code sent to your mobile/mail |
Sample Request (Body)
{
“otp”: 6 digit Code sent to your mobile/ mail
}
Sample Response
{
“status": "SUCCESS",
"message": "OTP VERFIED SUCCESSFULLY",
"errorcode": ""
}
Get Profile
This API allows to fetch the complete information of the user who is logged in
Method | POST |
Production URL | https://openapi.motilaloswal.com/rest/login/v1/getprofile |
Test URL | https://uatopenapi.motilaloswal.com/rest/login/v1/getprofile |
Request | None or JSON(In case of Dealer) |
Response | JSON |
Request JSON
Field | Type | Mandatory | Description |
---|---|---|---|
Clientcode | String(15) | N | Its mandatory in case of Dealer |
Sample Request (Body)
{
“clientcode":"Q02429” //in case of dealer else not required
}
Sample Response
{
"status": "SUCCESS",
"message": "Profile Data",
"errorcode": "",
"data": {
"clientcode": "Q02429",
"name": "CLIENT NAME",
"usertype": "Investor Client",
"exchanges": [
"NSE",
"BSE",
"NSEFO",
"NSECD"
],
"products": [
"NORMAL",
"DELIVERY"
],
"poastatus": "YES"
}
}
Response JSON
Field | Type | Description |
---|---|---|
Clientcode | String(20) | Client ID |
Name | String(30) | Name of Client or user |
Exchanges | String(50) | Name of the Exchanges - LIST |
Products | String(50) | Name of products - LIST |
Usertype | String(20) | User Type - Dealer Or Investor Client |
Logout
This API closes the current session in the HOST system.
Method | POST |
Production URL | https://openapi.motilaloswal.com/rest/login/v1/logout |
Test URL | https://uatopenapi.motilaloswal.com/rest/login/v1/logout |
Request | None |
Response | JSON |
Sample Request (Body)
{
“userid":"AA017” //in case of dealer else not required
}
Sample Response
{
"status": "SUCCESS",
"message": "LOGOUT SUCCESSFULL",
"errorcode": ""
}