# UpstoxDeveloperApi.UserApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**getProfile**](UserApi.md#getProfile) | **GET** /user/profile | Get profile
[**getUserFundMargin**](UserApi.md#getUserFundMargin) | **GET** /user/get-funds-and-margin | Get User Fund And Margin

<a name="getProfile"></a>
# **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
```javascript
import {UpstoxDeveloperApi} from 'upstox_developer_api';
let defaultClient = UpstoxDeveloperApi.ApiClient.instance;

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

let apiInstance = new UpstoxDeveloperApi.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**](GetProfileResponse.md)

### Authorization

[OAUTH2](../README.md#OAUTH2)

### HTTP request headers

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

<a name="getUserFundMargin"></a>
# **getUserFundMargin**
> GetUserFundMarginResponse getUserFundMargin(apiVersion, opts)

Get User Fund And Margin

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

### Example
```javascript
import {UpstoxDeveloperApi} from 'upstox_developer_api';
let defaultClient = UpstoxDeveloperApi.ApiClient.instance;

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

let apiInstance = new UpstoxDeveloperApi.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**](GetUserFundMarginResponse.md)

### Authorization

[OAUTH2](../README.md#OAUTH2)

### HTTP request headers

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

