Skip to main content

LOGIN API

This Api is used to authenticate users by validating their login credentials. Upon successful authentication, the API returns the following in the response :

  • access_token : This token must be includedin the Authorization header of all subsequnt API request to authorize the users session.
  • broadcase_access_token :This token is required to establish a connection with the feed endpoint, accessile via the broadCastSocket URL provided in the response. Please refer to the Price Feed API for detailed usage instructions.

Additionally, the response includes essential information for trading, such as: 

  • The list of exchanges allowed for the user.
  • Supported Product type.
  • Other key trading-related parameters.

This API is prerequisite for accessing all authenticated endpoints in the system.

🗝️Login Types and Second-Factor Authentication

login_typePassword Fieldsecond_auth-typesecond_auth_value
PASSWORDPasswordREGISTERNot required
TOKENregister_tokenOTP/TOTP/FINGERPRINTOTP Value/TOTP Value/Registered UDID
PASSWORDPasswordOTP/TOTP/FINGERPRINTOTP Value/TOTP Value/Registered UDID
MPINMPIN RegisteredOTP/TOTP/FINGERPRINTOTP Value/TOTP Value/Registered UDID
TP_TOKENSSO tokenNot RequiredNot Required

📝Authentication Flow Notes

  • To retrieve the second-factor authentication methods available for a user, user REGISTER in the second_auth_type field.
  • This will validate the provided password and return a register_token.
  • The returned register_token can then be used in a subsequent login attempt with login_type set to TOKEN, along with the appropriate second-factor credentials.

🔑Header Parameters

HeaderTypeDescriptionExample
Content-TypestringSpecifies the media type of the request payloadapplication/json
x-api-keystringAPI key used to authorize the requestx-api-key

📑Request Body Parameters

FieldTypeRequiredDescrpitonExample/Enum
user_idstringYesUser ID (UCC) Provided to the user"UCC123456"
login_typestringOptionalSpecifies the login method. Determines which vlaue is passed in the password field. Use TP_TOKEN when authentication is handled externally 9eg., via a Super APP)Default: "PASSWORD" Enum : PASSWORD, MPIN, FINGERPRINT, TP_TOKEN
passwordstringYesPassword, MPIN, UDID or SSO Token depnding on the login_type selected."mypassword123"
second_auth_tpestringOptionalType of secondary authentication selected by the user.User REGISTER on first login to register a second-factor method.Enum : OTP, TOTP, FINGERPRINT, REGISTER
second_authstringOptionalThe credential value for the selected secondary authentication type (e.g., OTP, TOTP,UDID)"123456"/"MyDeviceID"
api_keystringYesAPI Key providedby Synapsewavefor authenticating the client application"xyz-api-key"
sourcestringYesIndicates the platfrom from which the user is logging inEnum : WEBAPI, MOBILEAPI
UDIDStringOptionalUnique Device ID of the user's device."device-12345-udid"
versionstringOptionalversion number fo the Android application"2.1.0"
iosversionstringOptionalVersion number of the iOS application"3.0.5"
build_versionstringOptionalInternal build version of the application"build-45"
deviceinfoobjectOptionalAdditional information about the user's device (e.g., OS, model, etc){"os" : "Android", "model" : "Pixel 6"}

📘DeviceInfo Object Fields

FieldTypeDescriptionExample/ENUM
UDIDstringThe unique identifier for the device."123e4567-e89b-a456-426614174000"
DeviceModelstringThe model of the device from which the user has logged in."iPhone 12"
DeviceSerialNostringThe serial number of the device used for log in.SN1234567890
DeviceManufacturerstringThe manufacturer of the device used for login.Apple
DevicePlatformstringThe platform of the device used for loginWeb
DevicePlatformVerstringThe version of the platform (OS) on the device used for login.14.4
LongitudestringThe longitude coordinate of the device's location when logging in.77.5946
LatitudestringThe latitude coordinate of the device's location when logging in."12.9716"
AppNamestringThe name of the application being used for login.Wave 3.0
AppVersionstringThe version of the application used for login."1.2.3"
AppVersionCodestringThe version code of the application used for login."200000"
AppPackageNamestringThe package name of the application used for login (Android only).com.example.myapp
FCMRegKeystringThe Firebase Cloud Messaging (FCM) registration key for push notifications"172.25.90.82:8100
IPstringIP Address of the device used for login"192.168.1.1"
SDKVersionstringThe version of the software development kit (SDK) used for the application."30"

🟢Success Response - 200 Ok

Content-Type: application/json

FiledTypeDescriptionExmple
statusstringIndicates the result of the API call"success"
codestringResponse code corresponding to the request"s-101"
messagestringDescriptive message for the response"User logged in Successfully."
dataobjectContains the user login response payload, including token and user-specific trading informationSee below table

📑 Data object fields

FieldsTypeDescriptionExample / Enum
access_tokenstringThe authentication token to be used with subsequent requestseyJhbGci..
user_namestringUser's display nameAPI TEST
login_timestringUser's last login time (ISO 8601 recommended)2023-Sep-20 14:15:02
exchangesstring[]Exchanges allowed to the user["NSE_EQ","NSE_FO",..]
bcastExchangesstring[]Exchanges allowed to user for market feed data["NSE_EQ","NSE_FO","BSE_EQ"....]
product_typesstring[]Product types allowed to user across all exchanges["INTRADAY","DELIVERY","COVER","BRACKET","MTF","BTST"]
product_types_exchangeobjectProduct types allowed to user, keyed by exchange{ "NSE_FO": ["INTRADAY","DELIVERY","COVER","BRACKET"], ... }
mpin_enabledbooleanFlag indicating if user has registered MPINtrue
fingerprint_enabledbooleanFlag indicating if user has registered fingerprintfalse
user_idstringUser Id (UCC) provided to the userAPITEST
othersobjectAdditional user details (see below)See below table

📑 Others object fields

FieldsTypeDescriptionExample / Enum
userCodestringInternal user codeNWSYF
groupIdstringGroup identifier the user belongs toHO
groupCodestringGroup codeAAAAA
newsCategoriesstringNews categories available to the user"25051,25039,25038,25048,25028,25000..."
messageSocketstringEndpoint of socket.io server for receiving interactive messageswss://socketio-uat.odinwave.com:8443
broadCastSocketstringEndpoint of web socket server for receiving market feed datawss://odindemo.synapsewave.com:4510
secondBroadCastSocketstring[]Other market feed server endpoints["ws://Odindemo.synapsewave.com:4509"]
POAstringPOA status of user. Enum: "0" = POA user, "2" = Non POA user"0"
nGTDDefaultintegerDefault GTD (Good Till Date) days set2
nGTDMaxDaysintegerMaximum days allowed for GTD365
sGTDConfigDetailsstringGTD configuration details (serialized or human readable)`"2
ocTokenstringOC (order control / other) token0x01C1DBD524FBF3C904A6BCF65D29DC
managerIPstringManager IP address (if applicable)Odindemo.synapsewave.com
tslAllowedstring[]TSL (trailing stop loss) allowed settings["NSE_EQ","NSE_FO","BSE_EQ"...]
edisForMTFbooleanEDIS (Electronic DIS) availability for MTF (Margin Trading Facility)false
showJumpPriceBothLtpAndTriggerPricebooleanFlag to show jump price for both LTP and trigger pricefalse
CFTstringCFT field (context-specific)HEATMAP1
bAMOAllowedForUserbooleanWhether AMO (After Market Order) is allowed for the usertrue
post/authentication/v1/user/session