Skip to content

Latest commit

 

History

History
108 lines (76 loc) · 2.83 KB

UserApi.md

File metadata and controls

108 lines (76 loc) · 2.83 KB

UpstoxClient.UserApi

All URIs are relative to https://api-v2.upstox.com

Method HTTP request Description
getProfile GET /user/profile Get profile
getUserFundMargin GET /user/get-funds-and-margin Get User Fund And Margin

getProfile

GetProfileResponse getProfile(apiVersion)

Get profile

This API allows to fetch the complete information of the user who is logged in including the products, order types and exchanges enabled for the user

Example

import {UpstoxClient} from 'upstox-js-sdk';
let defaultClient = UpstoxClient.ApiClient.instance;

// Configure OAuth2 access token for authorization: OAUTH2
let OAUTH2 = defaultClient.authentications['OAUTH2'];
OAUTH2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new UpstoxClient.UserApi();
let apiVersion = "apiVersion_example"; // String | API Version Header

apiInstance.getProfile(apiVersion, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
apiVersion String API Version Header

Return type

GetProfileResponse

Authorization

OAUTH2

HTTP request headers

  • Content-Type: Not defined
  • Accept: /, application/json

getUserFundMargin

GetUserFundMarginResponse getUserFundMargin(apiVersion, opts)

Get User Fund And Margin

Shows the balance of the user in equity and commodity market.

Example

import {UpstoxClient} from 'upstox-js-sdk';
let defaultClient = UpstoxClient.ApiClient.instance;

// Configure OAuth2 access token for authorization: OAUTH2
let OAUTH2 = defaultClient.authentications['OAUTH2'];
OAUTH2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new UpstoxClient.UserApi();
let apiVersion = "apiVersion_example"; // String | API Version Header
let opts = { 
  'segment': "segment_example" // String | 
};
apiInstance.getUserFundMargin(apiVersion, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
apiVersion String API Version Header
segment String [optional]

Return type

GetUserFundMarginResponse

Authorization

OAUTH2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, /