All URIs are relative to https://api-v2.upstox.com
Method | HTTP request | Description |
---|---|---|
authorize | GET /login/authorization/dialog | Authorize API |
logout | DELETE /logout | Logout |
token | POST /login/authorization/token | Get token API |
authorize(clientId, redirectUri, apiVersion, opts)
Authorize API
This provides details on the login endpoint.
import {UpstoxClient} from 'upstox-js-sdk';
let apiInstance = new UpstoxClient.LoginApi();
let clientId = "clientId_example"; // String |
let redirectUri = "redirectUri_example"; // String |
let apiVersion = "apiVersion_example"; // String | API Version Header
let opts = {
'state': "state_example", // String |
'scope': "scope_example" // String |
};
apiInstance.authorize(clientId, redirectUri, apiVersion, opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});
Name | Type | Description | Notes |
---|---|---|---|
clientId | String | ||
redirectUri | String | ||
apiVersion | String | API Version Header | |
state | String | [optional] | |
scope | String | [optional] |
null (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/json, /
LogoutResponse logout(apiVersion)
Logout
Logout
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.LoginApi();
let apiVersion = "apiVersion_example"; // String | API Version Header
apiInstance.logout(apiVersion, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
apiVersion | String | API Version Header |
- Content-Type: Not defined
- Accept: /, application/json
TokenResponse token(apiVersion, opts)
Get token API
This API provides the functionality to obtain opaque token from authorization_code exchange and also provides the user’s profile in the same response.
import {UpstoxClient} from 'upstox-js-sdk';
let apiInstance = new UpstoxClient.LoginApi();
let apiVersion = "apiVersion_example"; // String | API Version Header
let opts = {
'code': "code_example", // String |
'clientId': "clientId_example", // String |
'clientSecret': "clientSecret_example", // String |
'redirectUri': "redirectUri_example", // String |
'grantType': "grantType_example" // String |
};
apiInstance.token(apiVersion, opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
apiVersion | String | API Version Header | |
code | String | [optional] | |
clientId | String | [optional] | |
clientSecret | String | [optional] | |
redirectUri | String | [optional] | |
grantType | String | [optional] |
No authorization required
- Content-Type: application/x-www-form-urlencoded
- Accept: application/json, /