API functions to validate trading account credentials. In validation, AutoTrader Web tries to login to the stock broker’s trading platform. This method can be used every morning before market starts, to identify accounts which have incorrect/expired credentials.
There are 3 different apis:
- Validate Credentials (This shall be used to validate credentials before adding an account in the system)
- Validate Account (This shall be used to validate credentials of a single trading account which is already present in the system)
- Validate All Accounts (This shall be used to validate credentials of ALL accounts available under your user).
- Note: This validate all method only checks LIVE accounts.
This API is primarily designed for application developers who are going to create customized trading applications using our broker independent trading APIs.
Example – Validate Credentials
curl https://apix.stocksdeveloper.in/account/validateCredentials \
-H "api-key: <your_api_key>" \
-d "broker=broker_name" \
-d "loginId=login_id" \
-d "password=password" \
-d "totpKey=totp_key"
Response [Success]
{
"result": true,
"message": null,
"status": true,
"commandId": "d26a6efb-0690-4fc2-bba1-04fda58db03e"
}
Response [Failure]
{
"result": false,
"message": "Error from Choice: [10002 - Incorrect Client ID or Password. Attempt 1 of 5]",
"status": true,
"commandId": "cc577516-0de1-4e1e-bc61-0b8007db1722"
}
Example – Validate Account
curl https://apix.stocksdeveloper.in/account/validateAccount \
-H "api-key: <your_api_key>" \
-d "tradingAccId=23502007"
Response
Response structure is same as Validate Credentials response shown above.
Example – Validate All Accounts
curl https://apix.stocksdeveloper.in/account/validateAllAccounts \
-H "api-key: <your_api_key>"
Response [Success]
{
"result": [
{
"tradingAccId": 23409730,
"pseudoAccId": 23409731,
"valid": true,
"result": "SUCCESS",
"message": "SUCCESS",
"tradingAccLoginId": "NM291"
},
{
"tradingAccId": 23502007,
"pseudoAccId": 23502008,
"valid": false,
"result": "FAILURE",
"message": "Error from Upstox: [Access denied]",
"tradingAccLoginId": "159401"
}
],
"message": null,
"status": true,
"commandId": null
}
Parameters
- Validate Credentials – The parameters are same as Create Trading Account Parameters
- Validate Account
- tradingAccId – Unique trading account id generated by AutoTrader Web [Number – Long]. This can be obtained from Fetch All Trading Accounts API
- Validate All Accounts – No parameters
Response Fields
- Validate Credentials/Validate Account
- result – SUCCESS or FAILURE (depending on whether the trading account credential validation was successful)
- message – Success or error message
- Validate All Accounts
- result – A list of validation results for each trading account of the user
- result – SUCCESS or FAILURE
- message – Failure reason
- valid – true or false [Boolean]
- tradingAccLoginId – Trading account login id
- tradingAccId – Unique trading account id (internal)
- pseudoAccId – Unique pseudo account id (internal)
- result – A list of validation results for each trading account of the user
API Limits
This api is not expected to be used repeatedly, hence it has stricter API Limits compared to the other apis.
- Validate Credentials/Validate Account
- Max 100 requests are allowed in 1 min
- Max 1000 requests are allowed in 1 hour
- Validate All Accounts
- Max 10 requests are allowed in 1 min
- Max 100 requests are allowed in 1 hour