User details
This sections let’s us know how to fetch the information of the logged in user.
Method POST
https://connect.thefirstock.com/api/V3/userDetails
Request details
Parameter | Description | Data types | Example |
---|---|---|---|
userId | User Id of the login user | String | "AA1999" |
jKey | Token received from login API | String | "150c4971ef34f705a800f 4a8b9b97b99cc785fb3008 d9aa8c621f0264c966ff1" |
- cURL
curl --location 'https://connect.thefirstock.com/api/V3/userDetails' \
--header 'Content-Type: application/json' \
--data '{
"userId": "AA123",
"jKey": "e6a211bea63adff386578988e1cf4a9521c4744e6a39ad63174c8797e2af8c38"
}'
from thefirstock import thefirstock
userDetails = thefirstock.firstock_userDetails()
const Firstock = require("thefirstock");
const firstock = new Firstock();
firstock.getUserDetails((err, result) => {
console.log("Error, ", err);
console.log("Result: ", result);
});
using thefirstock;
class Program
{
public static void Main()
{
Firstock firstock = new Firstock();
var userDetails = firstock.getUserDetails();
}
}
Success response details
Parameter | Description | Data types | Examples |
---|---|---|---|
data.requestTime | Response received time. | String | "17:01:12 10-02-2023" |
status | Success | String | "Success" |
data.userName | Name given to the user during registration. | String | "jon tester" |
data.actid | Account id | String | "SS1197" |
data.exchange | Json array of strings with enabled, allowed exchange names | String | "NSE","BSE","NIPO" |
data.orarr | Json array of Product Obj with enabled products, as defined below. | String | "LMT","MKT","SL-LMT","SL-MKT" |
data.uprev | Always it will be an INVESTOR, other types of user not allowed to login using this API. | String | "INVESTOR" |
data.email | E-mail given by the user | String | "[email protected]" |
Failure response details
Parameter | Description | Data Type | Example |
---|---|---|---|
status | Failed | String | "Failed" |
code | HTTP Code | String | "401" |
name | Type of error | String | "INVALID_JKEY" |
error.field | Error field | String | "jKey" |
error.message | Error message | String | "jKey parameter is invalid" |
Sample response
- Success response
- Failure response
{
"status": "Success",
"data": {
"requestTime": "16:47:03 01-09-2022",
"userName": "AA199",
"exchange": [
"NSE",
"BSE",
"NIPO"
],
"orarr": [
"LMT",
"MKT",
"SL-LMT",
"SL-MKT"
],
"email": "[email protected]"",
"actid": "SS1197",
"uprev": "INVESTOR",
}
}
{
"status": "Failed",
"code": "401",
"name": "INVALID_JKEY",
"error": {
"field": "jKey",
"message": "jKey parameter is invalid"
}
}