Login
Getting Started with Ventura EaseAPI
Ventura EaseAPI is designed for simplicity, enabling you to integrate Ventura's services into your applications with ease. Before you begin, you must register on the EaseAPI portal to obtain your app_key and app_secret, which are essential for authenticating your API requests. You can register by visiting the EaseAPI Portal at https://easeapi.venturasecurities.com/portal
Once you have your app_key
and app_secret
, you're ready to initiate the Ventura login flow. The following steps will guide you through the process:
Step 1:
To begin the login process, send a request to the login URL, including your app_key
. Optionally, you can include a state variable in this request. The state variable is a flexible parameter that you can use to pass any value you want, and it will be returned with the redirection URL after the login flow is completed. This can be useful for maintaining session information or tracking user interactions.
Step 2:
After a Ventura client successfully logs in, they will be redirected to a specified URL. This redirection URL will contain two query parameters: the request_token
and the state
(if it was provided in Step 1). The request_token
is a crucial component that you will need to proceed to the next step.
request_token
will only be valid for 10 minutes.
Step 3:
With the request_token obtained from the redirect URL, you must now generate the auth_token and refresh_token for the Ventura client. To do this, make a request to the Authorization Token API, including your request_token
and SHA256(app_key + secret_key) lower case
as part of the request. This API is essential for exchanging the request_token for the necessary authentication tokens.
import requests
import json
url = "https://easeapi.venturasecurities.com/login/v1/authorization/token"
payload = json.dumps({
"request_token": "uNYfFV9SsK",
"data": "cc13cb8677d51eb143b5903622ec9f423f5fa6b1ea69e32d783f9cfcb6a742ac"
})
headers = {
'x-app-key': '7LgeAMyKQgWL6ErlU1wm',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
const axios = require('axios');
let data = JSON.stringify({
"request_token": "uNYfFV9SsK",
"data": "cc13cb8677d51eb143b5903622ec9f423f5fa6b1ea69e32d783f9cfcb6a742ac"
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://easeapi.venturasecurities.com/login/v1/authorization/token',
headers: {
'x-app-key': '7LgeAMyKQgWL6ErlU1wm',
'Content-Type': 'application/json'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Step 4:
Upon a successful request, the Authorization Token API will return a response containing the following key pieces of data:
{
"client_id": "AA0605",
"auth_token": "eyJraWQiOiJmWTdRYVhEYlR6TGtwYXlzMWR1Qk1kTHViSzFHcWlhZnlGd1RQWFQ1V1dZPSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiI5NTg4MTg4Yy0yZWYxLTQ1MzktYWM0NC1kZmU1NzY4OGQyNTAiLCJpc3MiOiJodHRwczpcL1wvY29nbml0by1pZHAuYXAtc291dGgtMS5hbWF6b25hd3MuY29tXC9hcC1zb3V0aC0xX3Njc1VQdFM1QiIsImNsaWVudF9pZCI6IjUwdWVjOXJwN241cGVjaDliaDIxcTU3N3RjIiwib3JpZ2luX2p0aSI6Ijc1MTc2OWZkLTY1MzUtNDNhOC1hMmMzLWFmYTUwNzI2OWY1OSIsImV2ZW50X2lkIjoiZDA4ODE5NzQtNTE2OS00MGY0LWExOWItMDZmZDVkMTgxNGZkIiwidG9rZW5fdXNlIjoiYWNjZXNzIiwic2NvcGUiOiJhd3MuY29nbml0by5zaWduaW4udXNlci5hZG1pbiIsImF1dGhfdGltZSI6MTczNzQ0ODAxMSwiZXhwIjoxNzM3NTM0NDExLCJpYXQiOjE3Mzc0NDgwMTEsImp0aSI6IjZkODE4ZTFiLTk5OWQtNDgxZC1iNjUzLTAzMDUzNzE4NWExNCIsInVzZXJuYW1lIjoiYWEwNjA1In0.bWJWtsbttfKKIXfvo0DVW2TfRQ0o6tUnjdZl-Y5g3E6iZ1Bho_zyM0dnkXS1xZWjECjJ7_XILgJMdN2VoxmE8j1JPbAyOQSqasiKpuY48AsqNoYaHEcOpDOm1KhQA9urgDZET9VOzfTeIqOxmJicNSMVtKE38bPEzETR7zuwpm7M7PtS1TAS6KJj2EBYZ7BeOskTUiAMA5zOR4aDZOCf7Z_KLOZpO_JOrkjaQJHoNHHq2eZGZZlVQMDugrUtNtE62sywCFpcPy8N331KSE1ygUwtBjAI34-ZK0OFanrB3pzCochetrEd_X0FUTpIHQa3b-QfUh895_BZUILGzzDDVQ",
"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