Skip to main content

Login & Profile

User Details

Provides the details of the Firstock user

Method: POST

https://connect.thefirstock.com/api/V4/userDetails

Request details

API Parameters
Parameter Description Example
userId
String
Identifier for the user upon login, unique
to each user in the system.
AA0013
jKey
String
Authentication token obtained from
the login API
150c4971ef34f705a800f4a8b9b97

Libraries and SDKs

Tabbed Interface
from thefirstock import thefirstock

userDetails = thefirstock.firstock_userDetails(userId="{{userId}}")
curl --location --request POST 'https://connect.thefirstock.com/api/V4/userDetails' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jKey": "{{jKey}}",
    "userId": "{{userId}}"
}'
const Firstock = require("thefirstock");

const firstock = new Firstock();

firstock.getUserDetails({ userId="{{userId}}" },(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(userId="{{userId}}");
    }
}

Success response details

API Parameters
Parameter Description Example
data.requestTime
String
Timestamp indicating when the response
was received
17:01:12 10-02-2023
status
String
Indicates the outcome of the API request success
data.userName
String
User's registered name jon tester
data.actid
String
User's account identifier AA0013
data.exchange
String
Exchange on which the order is placed
(e.g., NSE, BSE, NFO, BFO)
NSE
data.orarr
String
Array of enabled product types LMT, MKT, SL-LMT, SL-MKT
data.uprev
String
User type, restricted to 'INVESTOR' INVESTOR
data.email
String
Email address associated with the user account [email protected]
{
  "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",
      }
}

Failure response details

API Error Parameters
Parameter Description Example
status
String
Indicates the result status of the API operation failed
code
String
HTTP status code associated with the error 401
name
String
Specifies the type or category of the error encountered INVALID_JKEY
error.field
String
Field in the request that triggered the error jKey
error.message
String
Detailed message describing the error jKey parameter is invalid
{
  "status": "failed",
  "code": "401",
  "name": "INVALID_JKEY",
  "error": {
      "field": "jKey",
      "message": "jKey parameter is invalid"
  }
}