Report#
Resource used to generate various types of reports.
Endpoints:#
POST Report/Generate/Transaction/List UPDATED
GET Report/DownloadReport/{fileCode}/{fileName}/{accessCode}
GET Report/GetTA2Report#
Description:
Retrieves TA2 report data for regulatory compliance. Returns transfer activity and shareholder statistics.
Query Parameters:
Example Request:✓
curl --silent --location '{{baseurl}}/api/v1/Report/GetTA2Report?StartDate=2024-01-01T00:00:00Z&EndDate=2024-01-01T00:00:00Z&CountryType=All' \
--header 'Authorization: Bearer <YOUR TOKEN>'
#!/bin/bash
# Set up environment variables
CLIENT_ID="${SOLO_CLIENT_ID}"
CLIENT_SECRET="${SOLO_CLIENT_SECRET}"
# Define the OAuth2 Token Endpoint
TOKEN_ENDPOINT="{{baseurl}}/connect/token"
# Prepare and make the token request
TOKEN_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "${TOKEN_ENDPOINT}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=${CLIENT_ID}" \
-d "client_secret=${CLIENT_SECRET}")
# Extract HTTP status code and response body
HTTP_STATUS=$(echo "${TOKEN_RESPONSE}" | tail -n 1)
RESPONSE_BODY=$(echo "${TOKEN_RESPONSE}" | sed '$d')
# Handle the token response
if [ "${HTTP_STATUS}" -eq 200 ]; then
# Extract the access token
ACCESS_TOKEN=$(echo "${RESPONSE_BODY}" | grep -o '"access_token":"[^"]*"' | cut -d'"' -f4)
if [ -z "${ACCESS_TOKEN}" ]; then
echo "Error: Failed to extract access token from response"
exit 1
fi
else
echo "Error: Failed to obtain access token. HTTP Status: ${HTTP_STATUS}"
echo "Response: ${RESPONSE_BODY}"
exit 1
fi
# Define the API endpoint
API_ENDPOINT="{{baseurl}}/api/v1/Report/GetTA2Report"
# Make the API request to GetTA2Report
API_RESPONSE=$(curl -s -X GET "${API_ENDPOINT}?StartDate=2024-01-01T00:00:00Z&EndDate=2024-01-01T00:00:00Z&CountryType=All" \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H "Content-Type: application/json")
# Print the response
echo "${API_RESPONSE}"
import os
import requests
# Set up environment variables
client_id = os.environ.get("SOLO_CLIENT_ID")
client_secret = os.environ.get("SOLO_CLIENT_SECRET")
# Define the OAuth2 Token Endpoint
token_endpoint = "{{baseurl}}/connect/token"
# Prepare the Token Request Data
token_data = {
"grant_type": "client_credentials",
"client_id": client_id,
"client_secret": client_secret
}
# Make a POST Request to get token
token_response = requests.post(token_endpoint, data=token_data)
# Handle the Response
if token_response.status_code == 200:
access_token = token_response.json().get("access_token")
# Make the API Request
api_url = "{{baseurl}}/api/v1/Report/GetTA2Report"
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
params = {
"StartDate": "2024-01-01T00:00:00Z",
"EndDate": "2024-01-01T00:00:00Z",
"CountryType": "All"
}
api_response = requests.get(api_url, headers=headers, params=params)
# Print the Response
print(api_response.json())
else:
print(f"Error retrieving token: {token_response.status_code} - {token_response.text}")
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text.Json;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
// Set up environment variables
string clientId = Environment.GetEnvironmentVariable("SOLO_CLIENT_ID");
string clientSecret = Environment.GetEnvironmentVariable("SOLO_CLIENT_SECRET");
if (string.IsNullOrEmpty(clientId) || string.IsNullOrEmpty(clientSecret))
{
Console.WriteLine("Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set.");
return;
}
// Define the OAuth2 Token Endpoint
string tokenEndpoint = "{{baseurl}}/connect/token";
using HttpClient httpClient = new HttpClient();
// Prepare the token request data
var tokenRequestData = new Dictionary<string, string>
{
{ "grant_type", "client_credentials" },
{ "client_id", clientId },
{ "client_secret", clientSecret }
};
// Make a POST request to get token
var tokenRequestContent = new FormUrlEncodedContent(tokenRequestData);
try
{
HttpResponseMessage tokenResponse = await httpClient.PostAsync(tokenEndpoint, tokenRequestContent);
string accessToken = null;
// Handle the response
if (tokenResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
string tokenResponseBody = await tokenResponse.Content.ReadAsStringAsync();
JsonDocument tokenJson = JsonDocument.Parse(tokenResponseBody);
accessToken = tokenJson.RootElement.GetProperty("access_token").GetString();
}
else
{
Console.WriteLine($"Error retrieving token: {tokenResponse.StatusCode}");
string errorBody = await tokenResponse.Content.ReadAsStringAsync();
Console.WriteLine(errorBody);
return;
}
// Make the API request
string baseUrl = "{{baseurl}}";
string apiEndpoint = $"{baseUrl}/api/v1/Report/GetTA2Report?StartDate=2024-01-01T00:00:00Z&EndDate=2024-01-01T00:00:00Z&CountryType=All";
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage apiResponse = await httpClient.GetAsync(apiEndpoint);
// Print the response
string apiResponseBody = await apiResponse.Content.ReadAsStringAsync();
if (apiResponse.IsSuccessStatusCode)
{
JsonDocument jsonResponse = JsonDocument.Parse(apiResponseBody);
string formattedJson = JsonSerializer.Serialize(jsonResponse, new JsonSerializerOptions { WriteIndented = true });
Console.WriteLine(formattedJson);
}
else
{
Console.WriteLine($"API Error: {apiResponse.StatusCode}");
Console.WriteLine(apiResponseBody);
}
}
catch (Exception ex)
{
Console.WriteLine($"Exception occurred: {ex.Message}");
}
}
}
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
try {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST Request to get token
const tokenResponse = await makeRequest(tokenEndpoint, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
}, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting access token:', tokenResponse.body);
return;
}
const tokenResult = JSON.parse(tokenResponse.body);
const accessToken = tokenResult.access_token;
// Make the API Request to GetTA2Report endpoint
const apiUrl = '{{baseurl}}/api/v1/Report/GetTA2Report?StartDate=2024-01-01T00:00:00Z&EndDate=2024-01-01T00:00:00Z&CountryType=All';
const apiResponse = await makeRequest(apiUrl, {
method: 'GET',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
// Print the Response
if (apiResponse.statusCode === 200) {
const result = JSON.parse(apiResponse.body);
console.log(JSON.stringify(result, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Error:', error.message);
}
}
main();
import axios from 'axios';
const SOLO_CLIENT_ID = process.env.SOLO_CLIENT_ID;
const SOLO_CLIENT_SECRET = process.env.SOLO_CLIENT_SECRET;
const baseUrl = '{{baseurl}}';
const tokenEndpoint = `${baseUrl}/connect/token`;
async function getAccessToken(): Promise<string | null> {
const tokenRequestData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: SOLO_CLIENT_ID || '',
client_secret: SOLO_CLIENT_SECRET || '',
});
try {
const response = await axios.post(tokenEndpoint, tokenRequestData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
});
if (response.status === 200) {
return response.data.access_token;
} else {
console.error('Error retrieving token:', response.status, response.statusText);
return null;
}
} catch (error) {
console.error('Error retrieving token:', error);
return null;
}
}
async function getTA2Report(accessToken: string): Promise<void> {
const apiEndpoint = `${baseUrl}/api/v1/Report/GetTA2Report`;
const params = {
StartDate: '2024-01-01T00:00:00Z',
EndDate: '2024-01-01T00:00:00Z',
CountryType: 'All',
};
try {
const response = await axios.get(apiEndpoint, {
headers: {
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json',
},
params: params,
});
console.log('Response:', JSON.stringify(response.data, null, 2));
} catch (error) {
console.error('Error calling GetTA2Report:', error);
}
}
async function main(): Promise<void> {
const accessToken = await getAccessToken();
if (accessToken) {
await getTA2Report(accessToken);
} else {
console.error('Failed to obtain access token');
}
}
main();
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
try {
// Make a POST request to get token
const tokenResponse = await makeRequest(tokenEndpoint, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error obtaining access token:', tokenResponse.body);
return;
}
const tokenResult = JSON.parse(tokenResponse.body);
const accessToken = tokenResult.access_token;
// Make the API Request to GetTA2Report endpoint
const apiUrl = '{{baseurl}}/api/v1/Report/GetTA2Report?StartDate=2024-01-01T00:00:00Z&EndDate=2024-01-01T00:00:00Z&CountryType=All';
const apiResponse = await makeRequest(apiUrl, {
method: 'GET',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
// Print the Response
if (apiResponse.statusCode === 200) {
const jsonResponse = JSON.parse(apiResponse.body);
console.log(JSON.stringify(jsonResponse, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Error:', error.message);
}
}
main();
200 Response:
{
"data": []
}
GET Report/GetOwnershipPercentage#
Description:
Allows you to retrieve ownership details.
Query Parameters:
Blank = All Securities.
C = Common Securities.
P = Preferred Securities.
Blank = No series specified.
A = Series A.
B = Series B.
C = Series C.
Note
Refer to the Expanded Attributes and Options page for more info on securityType options.
Example Request:✓
curl --silent --location '{{baseurl}}/api/v1/Report/GetOwnershipPercentage?CustomerIssuerId=1&SystemControlIssuerId=1&SortBy=SortName&OrderBy=Ascending&Cutoff=2024-01-01T00:00:00Z&FilterSecurityType.SecurityTypeCode=example&FilterSecurityType.SecuritySeriesCode=example' \
--header 'Authorization: Bearer <YOUR TOKEN>'
#!/bin/bash
# Set up environment variables
CLIENT_ID="${SOLO_CLIENT_ID}"
CLIENT_SECRET="${SOLO_CLIENT_SECRET}"
# Define the OAuth2 Token Endpoint
TOKEN_ENDPOINT="{{baseurl}}/connect/token"
# Prepare and make the token request
TOKEN_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$TOKEN_ENDPOINT" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=$CLIENT_ID" \
-d "client_secret=$CLIENT_SECRET")
# Extract HTTP status code and response body
HTTP_STATUS=$(echo "$TOKEN_RESPONSE" | tail -n 1)
RESPONSE_BODY=$(echo "$TOKEN_RESPONSE" | sed '$d')
# Handle the response
if [ "$HTTP_STATUS" -eq 200 ]; then
# Extract the access token
ACCESS_TOKEN=$(echo "$RESPONSE_BODY" | grep -o '"access_token":"[^"]*"' | cut -d'"' -f4)
if [ -z "$ACCESS_TOKEN" ]; then
echo "Error: Failed to extract access token from response"
exit 1
fi
else
echo "Error: Failed to obtain access token. HTTP Status: $HTTP_STATUS"
echo "Response: $RESPONSE_BODY"
exit 1
fi
# Define the API endpoint
API_ENDPOINT="{{baseurl}}/api/v1/Report/GetOwnershipPercentage"
# Make the API request to GetOwnershipPercentage
API_RESPONSE=$(curl -s -X GET "$API_ENDPOINT?CustomerIssuerId=1&SystemControlIssuerId=1&SortBy=SortName&OrderBy=Ascending&Cutoff=2024-01-01T00:00:00Z&FilterSecurityType.SecurityTypeCode=example&FilterSecurityType.SecuritySeriesCode=example" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json")
# Print the response
echo "$API_RESPONSE"
import os
import requests
# Set up environment variables
client_id = os.environ.get("SOLO_CLIENT_ID")
client_secret = os.environ.get("SOLO_CLIENT_SECRET")
# Define the OAuth2 Token Endpoint
token_endpoint = "{{baseurl}}/connect/token"
# Prepare the Token Request Data
token_data = {
"grant_type": "client_credentials",
"client_id": client_id,
"client_secret": client_secret
}
# Make a POST Request to get token
token_response = requests.post(token_endpoint, data=token_data)
# Handle the Response
if token_response.status_code == 200:
access_token = token_response.json().get("access_token")
# Make the API Request
api_url = "{{baseurl}}/api/v1/Report/GetOwnershipPercentage"
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
params = {
"CustomerIssuerId": 1,
"SystemControlIssuerId": 1,
"SortBy": "SortName",
"OrderBy": "Ascending",
"Cutoff": "2024-01-01T00:00:00Z",
"FilterSecurityType.SecurityTypeCode": "example",
"FilterSecurityType.SecuritySeriesCode": "example"
}
api_response = requests.get(api_url, headers=headers, params=params)
# Print the Response
print(api_response.json())
else:
print(f"Error retrieving token: {token_response.status_code} - {token_response.text}")
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text.Json;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
// Set up environment variables
string clientId = Environment.GetEnvironmentVariable("SOLO_CLIENT_ID");
string clientSecret = Environment.GetEnvironmentVariable("SOLO_CLIENT_SECRET");
if (string.IsNullOrEmpty(clientId) || string.IsNullOrEmpty(clientSecret))
{
Console.WriteLine("Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set.");
return;
}
// Define the OAuth2 Token Endpoint
string tokenEndpoint = "{{baseurl}}/connect/token";
using HttpClient httpClient = new HttpClient();
// Prepare the Token Request Data
var tokenRequestData = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("grant_type", "client_credentials"),
new KeyValuePair<string, string>("client_id", clientId),
new KeyValuePair<string, string>("client_secret", clientSecret)
});
// Make a POST Request to get token
HttpResponseMessage tokenResponse = await httpClient.PostAsync(tokenEndpoint, tokenRequestData);
string accessToken = null;
// Handle the Response
if (tokenResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
string tokenResponseBody = await tokenResponse.Content.ReadAsStringAsync();
JsonDocument tokenJson = JsonDocument.Parse(tokenResponseBody);
accessToken = tokenJson.RootElement.GetProperty("access_token").GetString();
}
else
{
Console.WriteLine($"Error: Failed to retrieve access token. Status code: {tokenResponse.StatusCode}");
string errorBody = await tokenResponse.Content.ReadAsStringAsync();
Console.WriteLine($"Response: {errorBody}");
return;
}
// Make the API Request
string baseUrl = "{{baseurl}}";
string apiEndpoint = $"{baseUrl}/api/v1/Report/GetOwnershipPercentage";
// Build query parameters
var queryParams = new Dictionary<string, string>
{
{ "CustomerIssuerId", "1" },
{ "SystemControlIssuerId", "1" },
{ "SortBy", "SortName" },
{ "OrderBy", "Ascending" },
{ "Cutoff", "2024-01-01T00:00:00Z" },
{ "FilterSecurityType.SecurityTypeCode", "example" },
{ "FilterSecurityType.SecuritySeriesCode", "example" }
};
string queryString = string.Join("&", queryParams.Select(kvp => $"{Uri.EscapeDataString(kvp.Key)}={Uri.EscapeDataString(kvp.Value)}"));
string fullUrl = $"{apiEndpoint}?{queryString}";
// Set up the request with authorization header
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
// Make the GET request
HttpResponseMessage apiResponse = await httpClient.GetAsync(fullUrl);
// Print the Response
string responseBody = await apiResponse.Content.ReadAsStringAsync();
if (apiResponse.IsSuccessStatusCode)
{
try
{
JsonDocument jsonDoc = JsonDocument.Parse(responseBody);
string formattedJson = JsonSerializer.Serialize(jsonDoc, new JsonSerializerOptions { WriteIndented = true });
Console.WriteLine(formattedJson);
}
catch (JsonException)
{
Console.WriteLine(responseBody);
}
}
else
{
Console.WriteLine($"Error: API request failed. Status code: {apiResponse.StatusCode}");
Console.WriteLine($"Response: {responseBody}");
}
}
}
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({
statusCode: res.statusCode,
body: data
});
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST Request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode === 200) {
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request to GetOwnershipPercentage endpoint
const queryParams = new URLSearchParams({
CustomerIssuerId: '1',
SystemControlIssuerId: '1',
SortBy: 'SortName',
OrderBy: 'Ascending',
Cutoff: '2024-01-01T00:00:00Z',
'FilterSecurityType.SecurityTypeCode': 'example',
'FilterSecurityType.SecuritySeriesCode': 'example'
}).toString();
const apiUrl = `{{baseurl}}/api/v1/Report/GetOwnershipPercentage?${queryParams}`;
const apiOptions = {
method: 'GET',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error(`API request failed with status code: ${apiResponse.statusCode}`);
console.error(apiResponse.body);
}
} else {
console.error(`Failed to retrieve access token. Status code: ${tokenResponse.statusCode}`);
console.error(tokenResponse.body);
}
} catch (error) {
console.error('Error:', error.message);
}
}
main();
const https = require('https');
const http = require('http');
const url = require('url');
// Set up environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Function to make HTTP requests
function makeRequest(requestUrl, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = url.parse(requestUrl);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(requestUrl, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({
statusCode: res.statusCode,
body: data
});
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
try {
// Make a POST request to get token
const tokenResponse = await makeRequest(tokenEndpoint, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}, tokenData);
// Handle the Response
if (tokenResponse.statusCode === 200) {
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GetOwnershipPercentage?' + new URLSearchParams({
CustomerIssuerId: '1',
SystemControlIssuerId: '1',
SortBy: 'SortName',
OrderBy: 'Ascending',
Cutoff: '2024-01-01T00:00:00Z',
'FilterSecurityType.SecurityTypeCode': 'example',
'FilterSecurityType.SecuritySeriesCode': 'example'
}).toString();
const apiResponse = await makeRequest(apiUrl, {
method: 'GET',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error(`API request failed with status code: ${apiResponse.statusCode}`);
console.error(apiResponse.body);
}
} else {
console.error(`Token request failed with status code: ${tokenResponse.statusCode}`);
console.error(tokenResponse.body);
}
} catch (error) {
console.error('Error:', error.message);
}
}
main();
200 Response:
{
"accounts": [
{
"systemShareholderId": 123,
"customerShareholderId": "A-123",
"displayShareholderId": "A-123",
"sortName": "DOE, JOHN",
"name": "John Doe",
"securities": [
{
"securityType": "Common",
"numberOfCertificates": 2,
"numberOfCertificatesFormat": "2",
"totalShares": 1000,
"totalSharesFormat": "1,000",
"percentage": 50.0,
"percentageFormat": "50%"
}
]
}
],
"balances": [
{
"securityType": "Common",
"numOfShareholder": 2,
"numOfShareholderFormat": "2",
"totalOutstandingShares": 2000,
"totalOutstandingSharesFormat": "2,000",
"authorizedShares": 5000,
"authorizedSharesFormat": "5,000",
"isUnlimited": false
}
]
}
GET Report/GetDilutedPercentage#
Description:
Retrieves the ownership percentage for a given issuer.
Query Parameters:
Example Request:✓
curl --silent --location '{{baseurl}}/api/v1/Report/GetDilutedPercentage?CustomerIssuerId=1&SystemControlIssuerId=1' \
--header 'Authorization: Bearer <YOUR TOKEN>'
#!/bin/bash
# Retrieve credentials from environment variables
CLIENT_ID="${SOLO_CLIENT_ID}"
CLIENT_SECRET="${SOLO_CLIENT_SECRET}"
# Check if credentials are set
if [ -z "$CLIENT_ID" ] || [ -z "$CLIENT_SECRET" ]; then
echo "Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set"
exit 1
fi
# Define the OAuth2 Token Endpoint
TOKEN_ENDPOINT="{{baseurl}}/connect/token"
# Prepare and make the token request
TOKEN_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$TOKEN_ENDPOINT" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=$CLIENT_ID" \
-d "client_secret=$CLIENT_SECRET")
# Extract HTTP status code and response body
HTTP_STATUS=$(echo "$TOKEN_RESPONSE" | tail -n 1)
RESPONSE_BODY=$(echo "$TOKEN_RESPONSE" | sed '$d')
# Handle the token response
if [ "$HTTP_STATUS" -eq 200 ]; then
# Extract the access token from the response
ACCESS_TOKEN=$(echo "$RESPONSE_BODY" | grep -o '"access_token":"[^"]*"' | cut -d'"' -f4)
if [ -z "$ACCESS_TOKEN" ]; then
echo "Error: Failed to extract access token from response"
exit 1
fi
echo "Successfully obtained access token"
else
echo "Error: Failed to obtain access token. HTTP Status: $HTTP_STATUS"
echo "Response: $RESPONSE_BODY"
exit 1
fi
# Define the API endpoint
API_ENDPOINT="{{baseurl}}/api/v1/Report/GetDilutedPercentage"
# Make the API request
API_RESPONSE=$(curl -s -X GET "$API_ENDPOINT?CustomerIssuerId=1&SystemControlIssuerId=1" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json")
# Print the JSON response from the API
echo "API Response:"
echo "$API_RESPONSE"
import os
import requests
# Set up environment variables
client_id = os.environ.get("SOLO_CLIENT_ID")
client_secret = os.environ.get("SOLO_CLIENT_SECRET")
# Define the OAuth2 Token Endpoint
token_endpoint = "{{baseurl}}/connect/token"
# Prepare the Token Request Data
token_data = {
"grant_type": "client_credentials",
"client_id": client_id,
"client_secret": client_secret
}
# Make a POST Request to get token
token_response = requests.post(token_endpoint, data=token_data)
# Handle the Response
if token_response.status_code == 200:
access_token = token_response.json().get("access_token")
# Make the API Request
api_url = "{{baseurl}}/api/v1/Report/GetDilutedPercentage"
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
params = {
"CustomerIssuerId": 1,
"SystemControlIssuerId": 1,
}
api_response = requests.get(api_url, headers=headers, params=params)
# Print the Response
print(api_response.json())
else:
print(f"Error retrieving token: {token_response.status_code} - {token_response.text}")
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
// Set up environment variables
string clientId = Environment.GetEnvironmentVariable("SOLO_CLIENT_ID");
string clientSecret = Environment.GetEnvironmentVariable("SOLO_CLIENT_SECRET");
if (string.IsNullOrEmpty(clientId) || string.IsNullOrEmpty(clientSecret))
{
Console.WriteLine("Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set.");
return;
}
// Define the OAuth2 token endpoint
string tokenEndpoint = "{{baseurl}}/connect/token";
using HttpClient httpClient = new HttpClient();
// Prepare the token request data
var tokenRequestData = new Dictionary<string, string>
{
{ "grant_type", "client_credentials" },
{ "client_id", clientId },
{ "client_secret", clientSecret }
};
// Make a POST request to get token
var tokenRequestContent = new FormUrlEncodedContent(tokenRequestData);
HttpResponseMessage tokenResponse = await httpClient.PostAsync(tokenEndpoint, tokenRequestContent);
string accessToken = null;
// Handle the response
if (tokenResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
string tokenResponseBody = await tokenResponse.Content.ReadAsStringAsync();
JsonDocument tokenJson = JsonDocument.Parse(tokenResponseBody);
accessToken = tokenJson.RootElement.GetProperty("access_token").GetString();
}
else
{
Console.WriteLine($"Error retrieving token: {tokenResponse.StatusCode}");
string errorBody = await tokenResponse.Content.ReadAsStringAsync();
Console.WriteLine(errorBody);
return;
}
// Make the API request
string apiEndpoint = "{{baseurl}}/api/v1/Report/GetDilutedPercentage?CustomerIssuerId=1&SystemControlIssuerId=1";
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage apiResponse = await httpClient.GetAsync(apiEndpoint);
// Print the response
string apiResponseBody = await apiResponse.Content.ReadAsStringAsync();
if (apiResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
JsonDocument jsonResponse = JsonDocument.Parse(apiResponseBody);
string formattedJson = JsonSerializer.Serialize(jsonResponse, new JsonSerializerOptions { WriteIndented = true });
Console.WriteLine(formattedJson);
}
else
{
Console.WriteLine($"API Error: {apiResponse.StatusCode}");
Console.WriteLine(apiResponseBody);
}
}
}
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GetDilutedPercentage?CustomerIssuerId=1&SystemControlIssuerId=1';
const apiOptions = {
method: 'GET',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
import axios from 'axios';
const SOLO_CLIENT_ID = process.env.SOLO_CLIENT_ID;
const SOLO_CLIENT_SECRET = process.env.SOLO_CLIENT_SECRET;
const BASE_URL = '{{baseurl}}';
const TOKEN_ENDPOINT = `${BASE_URL}/connect/token`;
async function getAccessToken(): Promise<string | null> {
const tokenRequestData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: SOLO_CLIENT_ID || '',
client_secret: SOLO_CLIENT_SECRET || ''
});
try {
const response = await axios.post(TOKEN_ENDPOINT, tokenRequestData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
});
if (response.status === 200) {
return response.data.access_token;
} else {
console.error('Error retrieving token:', response.status, response.statusText);
return null;
}
} catch (error) {
console.error('Error retrieving token:', error);
return null;
}
}
async function callGetDilutedPercentage(accessToken: string): Promise<void> {
const apiEndpoint = `${BASE_URL}/api/v1/Report/GetDilutedPercentage`;
try {
const params = { CustomerIssuerId: 1, SystemControlIssuerId: 1 };
const response = await axios.get(apiEndpoint, {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
},
params: params
});
console.log(JSON.stringify(response.data, null, 2));
} catch (error) {
console.error('Error calling API:', error);
}
}
async function main(): Promise<void> {
if (!SOLO_CLIENT_ID || !SOLO_CLIENT_SECRET) {
console.error('Please set SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables');
return;
}
const accessToken = await getAccessToken();
if (accessToken) {
await callGetDilutedPercentage(accessToken);
} else {
console.error('Failed to obtain access token');
}
}
main();
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GetDilutedPercentage?CustomerIssuerId=1&SystemControlIssuerId=1';
const apiOptions = {
method: 'GET',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
200 Response:
{
"securites": [
{
"security": "Common",
"totalShares": 3516,
"totalSharesFormat": "3,516",
"shareholders": [
{
"systemShareholderId": 2824,
"customerShareholderId": "2824",
"displayShareholderId": "2824",
"name": "Chris P. Bacon Emily Demo JT TEN",
"isReserved": false,
"shares": 3242,
"sharesFormat": "3,242"
}
]
},
{
"security": "Preferred",
"totalShares": 250,
"totalSharesFormat": "250",
"shareholders": [
{
"systemShareholderId": 11981,
"customerShareholderId": "111144",
"displayShareholderId": "111144",
"name": "Omario Housni",
"isReserved": false,
"shares": 250,
"sharesFormat": "250"
}
]
}
]
}
POST Report/GenerateDilutedPercentage#
Description:
Generates a Diluted Percentage Report.
Request Body:
Example Request:✓
curl --silent --location --request POST '{{baseurl}}/api/v1/Report/GenerateDilutedPercentage' \
--header 'Authorization: Bearer <YOUR TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"customerIssuerId": 1,
"systemControlIssuerId": 1
}'
#!/bin/bash
# Retrieve credentials from environment variables
CLIENT_ID="${SOLO_CLIENT_ID}"
CLIENT_SECRET="${SOLO_CLIENT_SECRET}"
# Check if credentials are set
if [ -z "$CLIENT_ID" ] || [ -z "$CLIENT_SECRET" ]; then
echo "Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set"
exit 1
fi
# Define the OAuth2 Token Endpoint
TOKEN_ENDPOINT="{{baseurl}}/connect/token"
# Prepare and make the token request
TOKEN_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$TOKEN_ENDPOINT" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=$CLIENT_ID" \
-d "client_secret=$CLIENT_SECRET")
# Extract HTTP status code and response body
HTTP_STATUS=$(echo "$TOKEN_RESPONSE" | tail -n 1)
RESPONSE_BODY=$(echo "$TOKEN_RESPONSE" | sed '$d')
# Handle the token response
if [ "$HTTP_STATUS" -eq 200 ]; then
# Extract the access token from the response
ACCESS_TOKEN=$(echo "$RESPONSE_BODY" | grep -o '"access_token":"[^"]*"' | cut -d'"' -f4)
if [ -z "$ACCESS_TOKEN" ]; then
echo "Error: Failed to extract access token from response"
exit 1
fi
echo "Successfully obtained access token"
else
echo "Error: Failed to obtain access token. HTTP Status: $HTTP_STATUS"
echo "Response: $RESPONSE_BODY"
exit 1
fi
# Define the API endpoint
API_ENDPOINT="{{baseurl}}/api/v1/Report/GenerateDilutedPercentage"
# Make the API request
API_RESPONSE=$(curl -s -X POST "$API_ENDPOINT" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"customerIssuerId": 1,
"systemControlIssuerId": 1
}')
# Print the JSON response from the API
echo "API Response:"
echo "$API_RESPONSE"
import os
import requests
# Set up environment variables
client_id = os.environ.get("SOLO_CLIENT_ID")
client_secret = os.environ.get("SOLO_CLIENT_SECRET")
# Define the OAuth2 Token Endpoint
token_endpoint = "{{baseurl}}/connect/token"
# Prepare the Token Request Data
token_data = {
"grant_type": "client_credentials",
"client_id": client_id,
"client_secret": client_secret
}
# Make a POST Request to get token
token_response = requests.post(token_endpoint, data=token_data)
# Handle the Response
if token_response.status_code == 200:
access_token = token_response.json().get("access_token")
# Make the API Request
api_url = "{{baseurl}}/api/v1/Report/GenerateDilutedPercentage"
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
data = {
"customerIssuerId": 1,
"systemControlIssuerId": 1,
}
api_response = requests.post(api_url, headers=headers, json=data)
# Print the Response
print(api_response.json())
else:
print(f"Error retrieving token: {token_response.status_code} - {token_response.text}")
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
// Set up environment variables
string clientId = Environment.GetEnvironmentVariable("SOLO_CLIENT_ID");
string clientSecret = Environment.GetEnvironmentVariable("SOLO_CLIENT_SECRET");
if (string.IsNullOrEmpty(clientId) || string.IsNullOrEmpty(clientSecret))
{
Console.WriteLine("Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set.");
return;
}
// Define the OAuth2 token endpoint
string tokenEndpoint = "{{baseurl}}/connect/token";
using HttpClient httpClient = new HttpClient();
// Prepare the token request data
var tokenRequestData = new Dictionary<string, string>
{
{ "grant_type", "client_credentials" },
{ "client_id", clientId },
{ "client_secret", clientSecret }
};
// Make a POST request to get token
var tokenRequestContent = new FormUrlEncodedContent(tokenRequestData);
HttpResponseMessage tokenResponse = await httpClient.PostAsync(tokenEndpoint, tokenRequestContent);
string accessToken = null;
// Handle the response
if (tokenResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
string tokenResponseBody = await tokenResponse.Content.ReadAsStringAsync();
JsonDocument tokenJson = JsonDocument.Parse(tokenResponseBody);
accessToken = tokenJson.RootElement.GetProperty("access_token").GetString();
}
else
{
Console.WriteLine($"Error retrieving token: {tokenResponse.StatusCode}");
string errorBody = await tokenResponse.Content.ReadAsStringAsync();
Console.WriteLine(errorBody);
return;
}
// Make the API request
string apiEndpoint = "{{baseurl}}/api/v1/Report/GenerateDilutedPercentage";
var requestBody = new { customerIssuerId = 1, systemControlIssuerId = 1 };
var jsonContent = new StringContent(
JsonSerializer.Serialize(requestBody),
Encoding.UTF8,
"application/json");
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
HttpResponseMessage apiResponse = await httpClient.PostAsync(apiEndpoint, jsonContent);
// Print the response
string apiResponseBody = await apiResponse.Content.ReadAsStringAsync();
if (apiResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
JsonDocument jsonResponse = JsonDocument.Parse(apiResponseBody);
string formattedJson = JsonSerializer.Serialize(jsonResponse, new JsonSerializerOptions { WriteIndented = true });
Console.WriteLine(formattedJson);
}
else
{
Console.WriteLine($"API Error: {apiResponse.StatusCode}");
Console.WriteLine(apiResponseBody);
}
}
}
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateDilutedPercentage';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"systemControlIssuerId": 1
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
import axios from 'axios';
const SOLO_CLIENT_ID = process.env.SOLO_CLIENT_ID;
const SOLO_CLIENT_SECRET = process.env.SOLO_CLIENT_SECRET;
const BASE_URL = '{{baseurl}}';
const TOKEN_ENDPOINT = `${BASE_URL}/connect/token`;
async function getAccessToken(): Promise<string | null> {
const tokenRequestData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: SOLO_CLIENT_ID || '',
client_secret: SOLO_CLIENT_SECRET || ''
});
try {
const response = await axios.post(TOKEN_ENDPOINT, tokenRequestData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
});
if (response.status === 200) {
return response.data.access_token;
} else {
console.error('Error retrieving token:', response.status, response.statusText);
return null;
}
} catch (error) {
console.error('Error retrieving token:', error);
return null;
}
}
async function callGenerateDilutedPercentage(accessToken: string): Promise<void> {
const apiEndpoint = `${BASE_URL}/api/v1/Report/GenerateDilutedPercentage`;
try {
const requestBody = { customerIssuerId: 1, systemControlIssuerId: 1 };
const response = await axios.post(apiEndpoint, requestBody, {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
console.log(JSON.stringify(response.data, null, 2));
} catch (error) {
console.error('Error calling API:', error);
}
}
async function main(): Promise<void> {
if (!SOLO_CLIENT_ID || !SOLO_CLIENT_SECRET) {
console.error('Please set SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables');
return;
}
const accessToken = await getAccessToken();
if (accessToken) {
await callGenerateDilutedPercentage(accessToken);
} else {
console.error('Failed to obtain access token');
}
}
main();
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateDilutedPercentage';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"systemControlIssuerId": 1
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
200 Response:
{
"downloadUrl": "{{baseurl}}/Api/v1/Report/DownloadReport/CfDJ8G2a_F-j-rtGiUBjbT5isV1Ipqf4dR3GqLU2YxSgt48du3Ou-WqbxdXRIMvStv89lntvqfGdfX6LyQ2ZsxZ0WwFMw3wS_vPk4-yAYFAGb0J9Db4MTUzzBgXW3rWh-zWHKn0IEFZFbB1y9YZNc7Pqx60Ja_ATwXDQd4iFdYokEiPC/Diluted-Percentage.pdf/CfDJ8G2a_F-j-rtGiUBjbT5isV3Hu-jA7zMIrWfSA_7r-cX3Xf7T7H79utc9yZKwgwkaC3Ulo2Fs9kpX0MeahnEHr9HWBUmT5q9jCGVRizTQwdMrjFsCTm6RELhzi72RTLNi_hxxrJKwzMUFG80smDDvI5Y"
}
Description:
Generates detailed Shareholder List Reports.
Request Body:
Blank = All Securities.
C = Common Securities.
P = Preferred Securities.
Blank = No series specified.
A = Series A.
B = Series B.
C = Series C.
Note
Refer to the Expanded Attributes and Options page for more info on securityType options.
All = Restricted and Non-Restricted.
Restricted = Restricted Shares.
NonRestricted = Non-Restricted Shares.
Note
Only used for excel report(s).
Example Request:✓
curl --silent --location --request POST '{{baseurl}}/api/v1/Report/GenerateShareholderList' \
--header 'Authorization: Bearer <YOUR TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"customerIssuerId": 1,
"isPDF": true
}'
#!/bin/bash
# Retrieve credentials from environment variables
CLIENT_ID="${SOLO_CLIENT_ID}"
CLIENT_SECRET="${SOLO_CLIENT_SECRET}"
# Check if credentials are set
if [ -z "$CLIENT_ID" ] || [ -z "$CLIENT_SECRET" ]; then
echo "Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set"
exit 1
fi
# Define the OAuth2 Token Endpoint
TOKEN_ENDPOINT="{{baseurl}}/connect/token"
# Prepare and make the token request
TOKEN_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$TOKEN_ENDPOINT" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=$CLIENT_ID" \
-d "client_secret=$CLIENT_SECRET")
# Extract HTTP status code and response body
HTTP_STATUS=$(echo "$TOKEN_RESPONSE" | tail -n 1)
RESPONSE_BODY=$(echo "$TOKEN_RESPONSE" | sed '$d')
# Handle the token response
if [ "$HTTP_STATUS" -eq 200 ]; then
# Extract the access token from the response
ACCESS_TOKEN=$(echo "$RESPONSE_BODY" | grep -o '"access_token":"[^"]*"' | cut -d'"' -f4)
if [ -z "$ACCESS_TOKEN" ]; then
echo "Error: Failed to extract access token from response"
exit 1
fi
echo "Successfully obtained access token"
else
echo "Error: Failed to obtain access token. HTTP Status: $HTTP_STATUS"
echo "Response: $RESPONSE_BODY"
exit 1
fi
# Define the API endpoint
API_ENDPOINT="{{baseurl}}/api/v1/Report/GenerateShareholderList"
# Make the API request
API_RESPONSE=$(curl -s -X POST "$API_ENDPOINT" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"customerIssuerId": 1,
"isPDF": true
}')
# Print the JSON response from the API
echo "API Response:"
echo "$API_RESPONSE"
import os
import requests
# Set up environment variables
client_id = os.environ.get("SOLO_CLIENT_ID")
client_secret = os.environ.get("SOLO_CLIENT_SECRET")
# Define the OAuth2 Token Endpoint
token_endpoint = "{{baseurl}}/connect/token"
# Prepare the Token Request Data
token_data = {
"grant_type": "client_credentials",
"client_id": client_id,
"client_secret": client_secret
}
# Make a POST Request to get token
token_response = requests.post(token_endpoint, data=token_data)
# Handle the Response
if token_response.status_code == 200:
access_token = token_response.json().get("access_token")
# Make the API Request
api_url = "{{baseurl}}/api/v1/Report/GenerateShareholderList"
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
data = {
"customerIssuerId": 1,
"isPDF": True,
}
api_response = requests.post(api_url, headers=headers, json=data)
# Print the Response
print(api_response.json())
else:
print(f"Error retrieving token: {token_response.status_code} - {token_response.text}")
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
// Set up environment variables
string clientId = Environment.GetEnvironmentVariable("SOLO_CLIENT_ID");
string clientSecret = Environment.GetEnvironmentVariable("SOLO_CLIENT_SECRET");
if (string.IsNullOrEmpty(clientId) || string.IsNullOrEmpty(clientSecret))
{
Console.WriteLine("Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set.");
return;
}
// Define the OAuth2 token endpoint
string tokenEndpoint = "{{baseurl}}/connect/token";
using HttpClient httpClient = new HttpClient();
// Prepare the token request data
var tokenRequestData = new Dictionary<string, string>
{
{ "grant_type", "client_credentials" },
{ "client_id", clientId },
{ "client_secret", clientSecret }
};
// Make a POST request to get token
var tokenRequestContent = new FormUrlEncodedContent(tokenRequestData);
HttpResponseMessage tokenResponse = await httpClient.PostAsync(tokenEndpoint, tokenRequestContent);
string accessToken = null;
// Handle the response
if (tokenResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
string tokenResponseBody = await tokenResponse.Content.ReadAsStringAsync();
JsonDocument tokenJson = JsonDocument.Parse(tokenResponseBody);
accessToken = tokenJson.RootElement.GetProperty("access_token").GetString();
}
else
{
Console.WriteLine($"Error retrieving token: {tokenResponse.StatusCode}");
string errorBody = await tokenResponse.Content.ReadAsStringAsync();
Console.WriteLine(errorBody);
return;
}
// Make the API request
string apiEndpoint = "{{baseurl}}/api/v1/Report/GenerateShareholderList";
var requestBody = new { customerIssuerId = 1, isPDF = true };
var jsonContent = new StringContent(
JsonSerializer.Serialize(requestBody),
Encoding.UTF8,
"application/json");
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
HttpResponseMessage apiResponse = await httpClient.PostAsync(apiEndpoint, jsonContent);
// Print the response
string apiResponseBody = await apiResponse.Content.ReadAsStringAsync();
if (apiResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
JsonDocument jsonResponse = JsonDocument.Parse(apiResponseBody);
string formattedJson = JsonSerializer.Serialize(jsonResponse, new JsonSerializerOptions { WriteIndented = true });
Console.WriteLine(formattedJson);
}
else
{
Console.WriteLine($"API Error: {apiResponse.StatusCode}");
Console.WriteLine(apiResponseBody);
}
}
}
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateShareholderList';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"isPDF": true
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
import axios from 'axios';
const SOLO_CLIENT_ID = process.env.SOLO_CLIENT_ID;
const SOLO_CLIENT_SECRET = process.env.SOLO_CLIENT_SECRET;
const BASE_URL = '{{baseurl}}';
const TOKEN_ENDPOINT = `${BASE_URL}/connect/token`;
async function getAccessToken(): Promise<string | null> {
const tokenRequestData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: SOLO_CLIENT_ID || '',
client_secret: SOLO_CLIENT_SECRET || ''
});
try {
const response = await axios.post(TOKEN_ENDPOINT, tokenRequestData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
});
if (response.status === 200) {
return response.data.access_token;
} else {
console.error('Error retrieving token:', response.status, response.statusText);
return null;
}
} catch (error) {
console.error('Error retrieving token:', error);
return null;
}
}
async function callGenerateShareholderList(accessToken: string): Promise<void> {
const apiEndpoint = `${BASE_URL}/api/v1/Report/GenerateShareholderList`;
try {
const requestBody = { customerIssuerId: 1, isPDF: true };
const response = await axios.post(apiEndpoint, requestBody, {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
console.log(JSON.stringify(response.data, null, 2));
} catch (error) {
console.error('Error calling API:', error);
}
}
async function main(): Promise<void> {
if (!SOLO_CLIENT_ID || !SOLO_CLIENT_SECRET) {
console.error('Please set SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables');
return;
}
const accessToken = await getAccessToken();
if (accessToken) {
await callGenerateShareholderList(accessToken);
} else {
console.error('Failed to obtain access token');
}
}
main();
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateShareholderList';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"isPDF": true
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
200 Response:
{
"downloadUrl": "{{baseurl}}/Api/v1/Report/DownloadReport/CfDJ8G2a_F-j-rtGiUBjbT5isV2wcEw561cMP_pbSIaQkCXKbNmn6KI7RdZevTxnss634C7FI4lY-qsTUGCvoV7wohmATPxQb-Lf33SVyEm8KR1bbEJCf-HopdqUBbOGFkY2ri67QaY-KE9IL7M8LuUXQcFv7WNVzx0YWZ75P9qrjNrg/Shareholder-List.pdf/CfDJ8G2a_F-j-rtGiUBjbT5isV3h8RXKra1JIG5uf2274pKFfrJdFZ8UGyxvi63k9At7cDCyuT8LW1tGKDDF9ZwpTZz14s1mALgR1PWSr8qLNLKaaMJvdz5XNTJUf0LHfbcGp_3BabbmbG3ZGnSBr0ChtC0"
}
POST Report/GenerateHoldingsStatement#
Description:
Generates a Holding Statement.
Request Body:
yyyy-mm-dd
format (Year-Month-Day)
Blank = All Securities.
C = Common Securities.
P = Preferred Securities.
Blank = No series specified.
A = Series A.
B = Series B.
C = Series C.
Note
Refer to the Expanded Attributes and Options page for more info on securityType options.
All
)
Example Request:✓
curl --silent --location --request POST '{{baseurl}}/api/v1/Report/GenerateHoldingsStatement' \
--header 'Authorization: Bearer <YOUR TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"customerIssuerId": 1,
"isPDF": true
}'
#!/bin/bash
# Retrieve credentials from environment variables
CLIENT_ID="${SOLO_CLIENT_ID}"
CLIENT_SECRET="${SOLO_CLIENT_SECRET}"
# Check if credentials are set
if [ -z "$CLIENT_ID" ] || [ -z "$CLIENT_SECRET" ]; then
echo "Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set"
exit 1
fi
# Define the OAuth2 Token Endpoint
TOKEN_ENDPOINT="{{baseurl}}/connect/token"
# Prepare and make the token request
TOKEN_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$TOKEN_ENDPOINT" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=$CLIENT_ID" \
-d "client_secret=$CLIENT_SECRET")
# Extract HTTP status code and response body
HTTP_STATUS=$(echo "$TOKEN_RESPONSE" | tail -n 1)
RESPONSE_BODY=$(echo "$TOKEN_RESPONSE" | sed '$d')
# Handle the token response
if [ "$HTTP_STATUS" -eq 200 ]; then
# Extract the access token from the response
ACCESS_TOKEN=$(echo "$RESPONSE_BODY" | grep -o '"access_token":"[^"]*"' | cut -d'"' -f4)
if [ -z "$ACCESS_TOKEN" ]; then
echo "Error: Failed to extract access token from response"
exit 1
fi
echo "Successfully obtained access token"
else
echo "Error: Failed to obtain access token. HTTP Status: $HTTP_STATUS"
echo "Response: $RESPONSE_BODY"
exit 1
fi
# Define the API endpoint
API_ENDPOINT="{{baseurl}}/api/v1/Report/GenerateHoldingsStatement"
# Make the API request
API_RESPONSE=$(curl -s -X POST "$API_ENDPOINT" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"customerIssuerId": 1,
"isPDF": true
}')
# Print the JSON response from the API
echo "API Response:"
echo "$API_RESPONSE"
import os
import requests
# Set up environment variables
client_id = os.environ.get("SOLO_CLIENT_ID")
client_secret = os.environ.get("SOLO_CLIENT_SECRET")
# Define the OAuth2 Token Endpoint
token_endpoint = "{{baseurl}}/connect/token"
# Prepare the Token Request Data
token_data = {
"grant_type": "client_credentials",
"client_id": client_id,
"client_secret": client_secret
}
# Make a POST Request to get token
token_response = requests.post(token_endpoint, data=token_data)
# Handle the Response
if token_response.status_code == 200:
access_token = token_response.json().get("access_token")
# Make the API Request
api_url = "{{baseurl}}/api/v1/Report/GenerateHoldingsStatement"
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
data = {
"customerIssuerId": 1,
"isPDF": True,
}
api_response = requests.post(api_url, headers=headers, json=data)
# Print the Response
print(api_response.json())
else:
print(f"Error retrieving token: {token_response.status_code} - {token_response.text}")
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
// Set up environment variables
string clientId = Environment.GetEnvironmentVariable("SOLO_CLIENT_ID");
string clientSecret = Environment.GetEnvironmentVariable("SOLO_CLIENT_SECRET");
if (string.IsNullOrEmpty(clientId) || string.IsNullOrEmpty(clientSecret))
{
Console.WriteLine("Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set.");
return;
}
// Define the OAuth2 token endpoint
string tokenEndpoint = "{{baseurl}}/connect/token";
using HttpClient httpClient = new HttpClient();
// Prepare the token request data
var tokenRequestData = new Dictionary<string, string>
{
{ "grant_type", "client_credentials" },
{ "client_id", clientId },
{ "client_secret", clientSecret }
};
// Make a POST request to get token
var tokenRequestContent = new FormUrlEncodedContent(tokenRequestData);
HttpResponseMessage tokenResponse = await httpClient.PostAsync(tokenEndpoint, tokenRequestContent);
string accessToken = null;
// Handle the response
if (tokenResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
string tokenResponseBody = await tokenResponse.Content.ReadAsStringAsync();
JsonDocument tokenJson = JsonDocument.Parse(tokenResponseBody);
accessToken = tokenJson.RootElement.GetProperty("access_token").GetString();
}
else
{
Console.WriteLine($"Error retrieving token: {tokenResponse.StatusCode}");
string errorBody = await tokenResponse.Content.ReadAsStringAsync();
Console.WriteLine(errorBody);
return;
}
// Make the API request
string apiEndpoint = "{{baseurl}}/api/v1/Report/GenerateHoldingsStatement";
var requestBody = new { customerIssuerId = 1, isPDF = true };
var jsonContent = new StringContent(
JsonSerializer.Serialize(requestBody),
Encoding.UTF8,
"application/json");
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
HttpResponseMessage apiResponse = await httpClient.PostAsync(apiEndpoint, jsonContent);
// Print the response
string apiResponseBody = await apiResponse.Content.ReadAsStringAsync();
if (apiResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
JsonDocument jsonResponse = JsonDocument.Parse(apiResponseBody);
string formattedJson = JsonSerializer.Serialize(jsonResponse, new JsonSerializerOptions { WriteIndented = true });
Console.WriteLine(formattedJson);
}
else
{
Console.WriteLine($"API Error: {apiResponse.StatusCode}");
Console.WriteLine(apiResponseBody);
}
}
}
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateHoldingsStatement';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"isPDF": true
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
import axios from 'axios';
const SOLO_CLIENT_ID = process.env.SOLO_CLIENT_ID;
const SOLO_CLIENT_SECRET = process.env.SOLO_CLIENT_SECRET;
const BASE_URL = '{{baseurl}}';
const TOKEN_ENDPOINT = `${BASE_URL}/connect/token`;
async function getAccessToken(): Promise<string | null> {
const tokenRequestData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: SOLO_CLIENT_ID || '',
client_secret: SOLO_CLIENT_SECRET || ''
});
try {
const response = await axios.post(TOKEN_ENDPOINT, tokenRequestData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
});
if (response.status === 200) {
return response.data.access_token;
} else {
console.error('Error retrieving token:', response.status, response.statusText);
return null;
}
} catch (error) {
console.error('Error retrieving token:', error);
return null;
}
}
async function callGenerateHoldingsStatement(accessToken: string): Promise<void> {
const apiEndpoint = `${BASE_URL}/api/v1/Report/GenerateHoldingsStatement`;
try {
const requestBody = { customerIssuerId: 1, isPDF: true };
const response = await axios.post(apiEndpoint, requestBody, {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
console.log(JSON.stringify(response.data, null, 2));
} catch (error) {
console.error('Error calling API:', error);
}
}
async function main(): Promise<void> {
if (!SOLO_CLIENT_ID || !SOLO_CLIENT_SECRET) {
console.error('Please set SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables');
return;
}
const accessToken = await getAccessToken();
if (accessToken) {
await callGenerateHoldingsStatement(accessToken);
} else {
console.error('Failed to obtain access token');
}
}
main();
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateHoldingsStatement';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"isPDF": true
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
200 Response:
{
"downloadUrl": "{{baseurl}}/Api/v1/Report/DownloadReport/CfDJ8G2a_F-j-rtGiUBjbT5isV1QU_bcrzB7OMDIk4Rj96uf1rOh9P5X7HyHX1fM0NW3T6fXv7JC_hDGMdgiUCY3PJjVs935UeZ_7u7mMBd9E57-v7vKZS_8DYhVFd51dSc3S6LO3wS4H_JWT071KDPm3jmAy-5IN0CiHNc-P1h-erG4/holdings-statement.pdf/CfDJ8G2a_F-j-rtGiUBjbT5isV1UQ_FD2CjSQMgfGvT16Lp78h6vl9iWJKej-DkXuTkMTbrH1cPoQhm6k5K5Gh1Uh6n3wihmDYjTpXT9ZP_zhgmrTU7g38P_mn3WscfOJb1L99imnDX1yeDXmRJljxeN420"
}
POST Report/GenerateDRSStatement#
Description:
Generates a DRS statement.
Request Body:
Blank = All Securities.
C = Common Securities.
P = Preferred Securities.
Blank = No series specified.
A = Series A.
B = Series B.
C = Series C.
Note
Refer to the Expanded Attributes and Options page for more info on securityType options.
Example Request:✓
curl --silent --location --request POST '{{baseurl}}/api/v1/Report/GenerateDRSStatement' \
--header 'Authorization: Bearer <YOUR TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"customerIssuerId": 1,
"isPDF": true
}'
#!/bin/bash
# Retrieve credentials from environment variables
CLIENT_ID="${SOLO_CLIENT_ID}"
CLIENT_SECRET="${SOLO_CLIENT_SECRET}"
# Check if credentials are set
if [ -z "$CLIENT_ID" ] || [ -z "$CLIENT_SECRET" ]; then
echo "Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set"
exit 1
fi
# Define the OAuth2 Token Endpoint
TOKEN_ENDPOINT="{{baseurl}}/connect/token"
# Prepare and make the token request
TOKEN_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$TOKEN_ENDPOINT" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=$CLIENT_ID" \
-d "client_secret=$CLIENT_SECRET")
# Extract HTTP status code and response body
HTTP_STATUS=$(echo "$TOKEN_RESPONSE" | tail -n 1)
RESPONSE_BODY=$(echo "$TOKEN_RESPONSE" | sed '$d')
# Handle the token response
if [ "$HTTP_STATUS" -eq 200 ]; then
# Extract the access token from the response
ACCESS_TOKEN=$(echo "$RESPONSE_BODY" | grep -o '"access_token":"[^"]*"' | cut -d'"' -f4)
if [ -z "$ACCESS_TOKEN" ]; then
echo "Error: Failed to extract access token from response"
exit 1
fi
echo "Successfully obtained access token"
else
echo "Error: Failed to obtain access token. HTTP Status: $HTTP_STATUS"
echo "Response: $RESPONSE_BODY"
exit 1
fi
# Define the API endpoint
API_ENDPOINT="{{baseurl}}/api/v1/Report/GenerateDRSStatement"
# Make the API request
API_RESPONSE=$(curl -s -X POST "$API_ENDPOINT" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"customerIssuerId": 1,
"isPDF": true
}')
# Print the JSON response from the API
echo "API Response:"
echo "$API_RESPONSE"
import os
import requests
# Set up environment variables
client_id = os.environ.get("SOLO_CLIENT_ID")
client_secret = os.environ.get("SOLO_CLIENT_SECRET")
# Define the OAuth2 Token Endpoint
token_endpoint = "{{baseurl}}/connect/token"
# Prepare the Token Request Data
token_data = {
"grant_type": "client_credentials",
"client_id": client_id,
"client_secret": client_secret
}
# Make a POST Request to get token
token_response = requests.post(token_endpoint, data=token_data)
# Handle the Response
if token_response.status_code == 200:
access_token = token_response.json().get("access_token")
# Make the API Request
api_url = "{{baseurl}}/api/v1/Report/GenerateDRSStatement"
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
data = {
"customerIssuerId": 1,
"isPDF": True,
}
api_response = requests.post(api_url, headers=headers, json=data)
# Print the Response
print(api_response.json())
else:
print(f"Error retrieving token: {token_response.status_code} - {token_response.text}")
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
// Set up environment variables
string clientId = Environment.GetEnvironmentVariable("SOLO_CLIENT_ID");
string clientSecret = Environment.GetEnvironmentVariable("SOLO_CLIENT_SECRET");
if (string.IsNullOrEmpty(clientId) || string.IsNullOrEmpty(clientSecret))
{
Console.WriteLine("Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set.");
return;
}
// Define the OAuth2 token endpoint
string tokenEndpoint = "{{baseurl}}/connect/token";
using HttpClient httpClient = new HttpClient();
// Prepare the token request data
var tokenRequestData = new Dictionary<string, string>
{
{ "grant_type", "client_credentials" },
{ "client_id", clientId },
{ "client_secret", clientSecret }
};
// Make a POST request to get token
var tokenRequestContent = new FormUrlEncodedContent(tokenRequestData);
HttpResponseMessage tokenResponse = await httpClient.PostAsync(tokenEndpoint, tokenRequestContent);
string accessToken = null;
// Handle the response
if (tokenResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
string tokenResponseBody = await tokenResponse.Content.ReadAsStringAsync();
JsonDocument tokenJson = JsonDocument.Parse(tokenResponseBody);
accessToken = tokenJson.RootElement.GetProperty("access_token").GetString();
}
else
{
Console.WriteLine($"Error retrieving token: {tokenResponse.StatusCode}");
string errorBody = await tokenResponse.Content.ReadAsStringAsync();
Console.WriteLine(errorBody);
return;
}
// Make the API request
string apiEndpoint = "{{baseurl}}/api/v1/Report/GenerateDRSStatement";
var requestBody = new { customerIssuerId = 1, isPDF = true };
var jsonContent = new StringContent(
JsonSerializer.Serialize(requestBody),
Encoding.UTF8,
"application/json");
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
HttpResponseMessage apiResponse = await httpClient.PostAsync(apiEndpoint, jsonContent);
// Print the response
string apiResponseBody = await apiResponse.Content.ReadAsStringAsync();
if (apiResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
JsonDocument jsonResponse = JsonDocument.Parse(apiResponseBody);
string formattedJson = JsonSerializer.Serialize(jsonResponse, new JsonSerializerOptions { WriteIndented = true });
Console.WriteLine(formattedJson);
}
else
{
Console.WriteLine($"API Error: {apiResponse.StatusCode}");
Console.WriteLine(apiResponseBody);
}
}
}
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateDRSStatement';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"isPDF": true
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
import axios from 'axios';
const SOLO_CLIENT_ID = process.env.SOLO_CLIENT_ID;
const SOLO_CLIENT_SECRET = process.env.SOLO_CLIENT_SECRET;
const BASE_URL = '{{baseurl}}';
const TOKEN_ENDPOINT = `${BASE_URL}/connect/token`;
async function getAccessToken(): Promise<string | null> {
const tokenRequestData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: SOLO_CLIENT_ID || '',
client_secret: SOLO_CLIENT_SECRET || ''
});
try {
const response = await axios.post(TOKEN_ENDPOINT, tokenRequestData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
});
if (response.status === 200) {
return response.data.access_token;
} else {
console.error('Error retrieving token:', response.status, response.statusText);
return null;
}
} catch (error) {
console.error('Error retrieving token:', error);
return null;
}
}
async function callGenerateDRSStatement(accessToken: string): Promise<void> {
const apiEndpoint = `${BASE_URL}/api/v1/Report/GenerateDRSStatement`;
try {
const requestBody = { customerIssuerId: 1, isPDF: true };
const response = await axios.post(apiEndpoint, requestBody, {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
console.log(JSON.stringify(response.data, null, 2));
} catch (error) {
console.error('Error calling API:', error);
}
}
async function main(): Promise<void> {
if (!SOLO_CLIENT_ID || !SOLO_CLIENT_SECRET) {
console.error('Please set SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables');
return;
}
const accessToken = await getAccessToken();
if (accessToken) {
await callGenerateDRSStatement(accessToken);
} else {
console.error('Failed to obtain access token');
}
}
main();
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateDRSStatement';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"isPDF": true
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
200 Response:
{
"downloadUrl": "{{baseurl}}/Api/v1/Report/DownloadReport/CfDJ8G2a_F-j-rtGiUBjbT5isV1MgiNYlrXARXztdal9Bfjp4AlskfjaGeYNaNAvkykFAtxJZgWKGMv7FN0_7833paOaUVgRncSWlU6vW1Cmn9v7n2PAhB23UPuWsMzCmA_MkFqJvk_7CTlxCBGtyt0hqnfuj5-CM4kXAv_qVvw9-yqW/drs-statement.pdf/CfDJ8G2a_F-j-rtGiUBjbT5isV1OojEp18qP2BaqvfxmvSZyUcIHL5y-tPM5HxEJRlKQJiJ42F7e7h8ZygwvNaKkNewYAP7JiyBVtxdb9cAjGX2RMyKAI6XXoNxjjuEulGQalrRUrzXFt_DrDcBsos1_YKE"
}
POST Report/GenerateRejectionList#
Description:
Generates a Rejection List.
Request Body:
MasterRejection = DTC & Medallion Rejection.
DTCRejection = DTC Rejection.
MedallionRejection = Medallion Rejection.
ISO 8601 format = standardized date-time representation.
true = displays invoice number created by system.
false = does not display invoice number created by system.
Example Request:✓
curl --silent --location --request POST '{{baseurl}}/api/v1/Report/GenerateRejectionList' \
--header 'Authorization: Bearer <YOUR TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"customerIssuerId": 1,
"isPDF": true
}'
#!/bin/bash
# Retrieve credentials from environment variables
CLIENT_ID="${SOLO_CLIENT_ID}"
CLIENT_SECRET="${SOLO_CLIENT_SECRET}"
# Check if credentials are set
if [ -z "$CLIENT_ID" ] || [ -z "$CLIENT_SECRET" ]; then
echo "Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set"
exit 1
fi
# Define the OAuth2 Token Endpoint
TOKEN_ENDPOINT="{{baseurl}}/connect/token"
# Prepare and make the token request
TOKEN_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$TOKEN_ENDPOINT" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=$CLIENT_ID" \
-d "client_secret=$CLIENT_SECRET")
# Extract HTTP status code and response body
HTTP_STATUS=$(echo "$TOKEN_RESPONSE" | tail -n 1)
RESPONSE_BODY=$(echo "$TOKEN_RESPONSE" | sed '$d')
# Handle the token response
if [ "$HTTP_STATUS" -eq 200 ]; then
# Extract the access token from the response
ACCESS_TOKEN=$(echo "$RESPONSE_BODY" | grep -o '"access_token":"[^"]*"' | cut -d'"' -f4)
if [ -z "$ACCESS_TOKEN" ]; then
echo "Error: Failed to extract access token from response"
exit 1
fi
echo "Successfully obtained access token"
else
echo "Error: Failed to obtain access token. HTTP Status: $HTTP_STATUS"
echo "Response: $RESPONSE_BODY"
exit 1
fi
# Define the API endpoint
API_ENDPOINT="{{baseurl}}/api/v1/Report/GenerateRejectionList"
# Make the API request
API_RESPONSE=$(curl -s -X POST "$API_ENDPOINT" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"customerIssuerId": 1,
"isPDF": true
}')
# Print the JSON response from the API
echo "API Response:"
echo "$API_RESPONSE"
import os
import requests
# Set up environment variables
client_id = os.environ.get("SOLO_CLIENT_ID")
client_secret = os.environ.get("SOLO_CLIENT_SECRET")
# Define the OAuth2 Token Endpoint
token_endpoint = "{{baseurl}}/connect/token"
# Prepare the Token Request Data
token_data = {
"grant_type": "client_credentials",
"client_id": client_id,
"client_secret": client_secret
}
# Make a POST Request to get token
token_response = requests.post(token_endpoint, data=token_data)
# Handle the Response
if token_response.status_code == 200:
access_token = token_response.json().get("access_token")
# Make the API Request
api_url = "{{baseurl}}/api/v1/Report/GenerateRejectionList"
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
data = {
"customerIssuerId": 1,
"isPDF": True,
}
api_response = requests.post(api_url, headers=headers, json=data)
# Print the Response
print(api_response.json())
else:
print(f"Error retrieving token: {token_response.status_code} - {token_response.text}")
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
// Set up environment variables
string clientId = Environment.GetEnvironmentVariable("SOLO_CLIENT_ID");
string clientSecret = Environment.GetEnvironmentVariable("SOLO_CLIENT_SECRET");
if (string.IsNullOrEmpty(clientId) || string.IsNullOrEmpty(clientSecret))
{
Console.WriteLine("Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set.");
return;
}
// Define the OAuth2 token endpoint
string tokenEndpoint = "{{baseurl}}/connect/token";
using HttpClient httpClient = new HttpClient();
// Prepare the token request data
var tokenRequestData = new Dictionary<string, string>
{
{ "grant_type", "client_credentials" },
{ "client_id", clientId },
{ "client_secret", clientSecret }
};
// Make a POST request to get token
var tokenRequestContent = new FormUrlEncodedContent(tokenRequestData);
HttpResponseMessage tokenResponse = await httpClient.PostAsync(tokenEndpoint, tokenRequestContent);
string accessToken = null;
// Handle the response
if (tokenResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
string tokenResponseBody = await tokenResponse.Content.ReadAsStringAsync();
JsonDocument tokenJson = JsonDocument.Parse(tokenResponseBody);
accessToken = tokenJson.RootElement.GetProperty("access_token").GetString();
}
else
{
Console.WriteLine($"Error retrieving token: {tokenResponse.StatusCode}");
string errorBody = await tokenResponse.Content.ReadAsStringAsync();
Console.WriteLine(errorBody);
return;
}
// Make the API request
string apiEndpoint = "{{baseurl}}/api/v1/Report/GenerateRejectionList";
var requestBody = new { customerIssuerId = 1, isPDF = true };
var jsonContent = new StringContent(
JsonSerializer.Serialize(requestBody),
Encoding.UTF8,
"application/json");
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
HttpResponseMessage apiResponse = await httpClient.PostAsync(apiEndpoint, jsonContent);
// Print the response
string apiResponseBody = await apiResponse.Content.ReadAsStringAsync();
if (apiResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
JsonDocument jsonResponse = JsonDocument.Parse(apiResponseBody);
string formattedJson = JsonSerializer.Serialize(jsonResponse, new JsonSerializerOptions { WriteIndented = true });
Console.WriteLine(formattedJson);
}
else
{
Console.WriteLine($"API Error: {apiResponse.StatusCode}");
Console.WriteLine(apiResponseBody);
}
}
}
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateRejectionList';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"isPDF": true
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
import axios from 'axios';
const SOLO_CLIENT_ID = process.env.SOLO_CLIENT_ID;
const SOLO_CLIENT_SECRET = process.env.SOLO_CLIENT_SECRET;
const BASE_URL = '{{baseurl}}';
const TOKEN_ENDPOINT = `${BASE_URL}/connect/token`;
async function getAccessToken(): Promise<string | null> {
const tokenRequestData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: SOLO_CLIENT_ID || '',
client_secret: SOLO_CLIENT_SECRET || ''
});
try {
const response = await axios.post(TOKEN_ENDPOINT, tokenRequestData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
});
if (response.status === 200) {
return response.data.access_token;
} else {
console.error('Error retrieving token:', response.status, response.statusText);
return null;
}
} catch (error) {
console.error('Error retrieving token:', error);
return null;
}
}
async function callGenerateRejectionList(accessToken: string): Promise<void> {
const apiEndpoint = `${BASE_URL}/api/v1/Report/GenerateRejectionList`;
try {
const requestBody = { customerIssuerId: 1, isPDF: true };
const response = await axios.post(apiEndpoint, requestBody, {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
console.log(JSON.stringify(response.data, null, 2));
} catch (error) {
console.error('Error calling API:', error);
}
}
async function main(): Promise<void> {
if (!SOLO_CLIENT_ID || !SOLO_CLIENT_SECRET) {
console.error('Please set SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables');
return;
}
const accessToken = await getAccessToken();
if (accessToken) {
await callGenerateRejectionList(accessToken);
} else {
console.error('Failed to obtain access token');
}
}
main();
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateRejectionList';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"isPDF": true
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
200 Response:
{
"downloadUrl": "{{baseurl}}/Api/v1/Report/DownloadReport/CfDJ8G2a_F-j-rtGiUBjbT5isV2ISH2DjgT1oPl3XFxDrhUrD-oz1JTss0wRLUmKOBJd-XbtFkSTkAVBIorFv-ouatD-npnrXF9hJzhm6XofUZS1GH7G8L7sHo4EezhT4rnT7P2wNWrAPNWduhdOX7AUBLvNKNi_KjO88AbO1bwByukj/rejection-list.pdf/CfDJ8G2a_F-j-rtGiUBjbT5isV1uJDuq4x7wFpZHSfRd52zqBvTcKJTiNxlzmzGshksdBP4CyXPJVTs8kW_A2VMaIGS7sd9Mj9M25LZLXxiqRz7rvYQQdMqmS8H6ZhwJDim5pnnUaJx1PoOtUw14Be-OsNc"
}
POST Report/GenerateIssuerContacts#
Description:
Generates a downloadable report of an Issuer’s Contacts.
Request Body:
All = Active and Inactive Contacts.
Active = Active Contacts.
Inactive = Inactive Contacts.
Example Request:✓
curl --silent --location --request POST '{{baseurl}}/api/v1/Report/GenerateIssuerContacts' \
--header 'Authorization: Bearer <YOUR TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"customerIssuerId": 1,
"contactStatus": "All",
"isPDF": true
}'
#!/bin/bash
# Retrieve credentials from environment variables
CLIENT_ID="${SOLO_CLIENT_ID}"
CLIENT_SECRET="${SOLO_CLIENT_SECRET}"
# Check if credentials are set
if [ -z "$CLIENT_ID" ] || [ -z "$CLIENT_SECRET" ]; then
echo "Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set"
exit 1
fi
# Define the OAuth2 Token Endpoint
TOKEN_ENDPOINT="{{baseurl}}/connect/token"
# Prepare and make the token request
TOKEN_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$TOKEN_ENDPOINT" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=$CLIENT_ID" \
-d "client_secret=$CLIENT_SECRET")
# Extract HTTP status code and response body
HTTP_STATUS=$(echo "$TOKEN_RESPONSE" | tail -n 1)
RESPONSE_BODY=$(echo "$TOKEN_RESPONSE" | sed '$d')
# Handle the token response
if [ "$HTTP_STATUS" -eq 200 ]; then
# Extract the access token from the response
ACCESS_TOKEN=$(echo "$RESPONSE_BODY" | grep -o '"access_token":"[^"]*"' | cut -d'"' -f4)
if [ -z "$ACCESS_TOKEN" ]; then
echo "Error: Failed to extract access token from response"
exit 1
fi
echo "Successfully obtained access token"
else
echo "Error: Failed to obtain access token. HTTP Status: $HTTP_STATUS"
echo "Response: $RESPONSE_BODY"
exit 1
fi
# Define the API endpoint
API_ENDPOINT="{{baseurl}}/api/v1/Report/GenerateIssuerContacts"
# Make the API request
API_RESPONSE=$(curl -s -X POST "$API_ENDPOINT" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"customerIssuerId": 1,
"contactStatus": "All",
"isPDF": true
}')
# Print the JSON response from the API
echo "API Response:"
echo "$API_RESPONSE"
import os
import requests
# Set up environment variables
client_id = os.environ.get("SOLO_CLIENT_ID")
client_secret = os.environ.get("SOLO_CLIENT_SECRET")
# Define the OAuth2 Token Endpoint
token_endpoint = "{{baseurl}}/connect/token"
# Prepare the Token Request Data
token_data = {
"grant_type": "client_credentials",
"client_id": client_id,
"client_secret": client_secret
}
# Make a POST Request to get token
token_response = requests.post(token_endpoint, data=token_data)
# Handle the Response
if token_response.status_code == 200:
access_token = token_response.json().get("access_token")
# Make the API Request
api_url = "{{baseurl}}/api/v1/Report/GenerateIssuerContacts"
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
data = {
"customerIssuerId": 1,
"contactStatus": "All",
"isPDF": True,
}
api_response = requests.post(api_url, headers=headers, json=data)
# Print the Response
print(api_response.json())
else:
print(f"Error retrieving token: {token_response.status_code} - {token_response.text}")
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
// Set up environment variables
string clientId = Environment.GetEnvironmentVariable("SOLO_CLIENT_ID");
string clientSecret = Environment.GetEnvironmentVariable("SOLO_CLIENT_SECRET");
if (string.IsNullOrEmpty(clientId) || string.IsNullOrEmpty(clientSecret))
{
Console.WriteLine("Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set.");
return;
}
// Define the OAuth2 token endpoint
string tokenEndpoint = "{{baseurl}}/connect/token";
using HttpClient httpClient = new HttpClient();
// Prepare the token request data
var tokenRequestData = new Dictionary<string, string>
{
{ "grant_type", "client_credentials" },
{ "client_id", clientId },
{ "client_secret", clientSecret }
};
// Make a POST request to get token
var tokenRequestContent = new FormUrlEncodedContent(tokenRequestData);
HttpResponseMessage tokenResponse = await httpClient.PostAsync(tokenEndpoint, tokenRequestContent);
string accessToken = null;
// Handle the response
if (tokenResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
string tokenResponseBody = await tokenResponse.Content.ReadAsStringAsync();
JsonDocument tokenJson = JsonDocument.Parse(tokenResponseBody);
accessToken = tokenJson.RootElement.GetProperty("access_token").GetString();
}
else
{
Console.WriteLine($"Error retrieving token: {tokenResponse.StatusCode}");
string errorBody = await tokenResponse.Content.ReadAsStringAsync();
Console.WriteLine(errorBody);
return;
}
// Make the API request
string apiEndpoint = "{{baseurl}}/api/v1/Report/GenerateIssuerContacts";
var requestBody = new { customerIssuerId = 1, contactStatus = "All", isPDF = true };
var jsonContent = new StringContent(
JsonSerializer.Serialize(requestBody),
Encoding.UTF8,
"application/json");
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
HttpResponseMessage apiResponse = await httpClient.PostAsync(apiEndpoint, jsonContent);
// Print the response
string apiResponseBody = await apiResponse.Content.ReadAsStringAsync();
if (apiResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
JsonDocument jsonResponse = JsonDocument.Parse(apiResponseBody);
string formattedJson = JsonSerializer.Serialize(jsonResponse, new JsonSerializerOptions { WriteIndented = true });
Console.WriteLine(formattedJson);
}
else
{
Console.WriteLine($"API Error: {apiResponse.StatusCode}");
Console.WriteLine(apiResponseBody);
}
}
}
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateIssuerContacts';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"contactStatus": "All",
"isPDF": true
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
import axios from 'axios';
const SOLO_CLIENT_ID = process.env.SOLO_CLIENT_ID;
const SOLO_CLIENT_SECRET = process.env.SOLO_CLIENT_SECRET;
const BASE_URL = '{{baseurl}}';
const TOKEN_ENDPOINT = `${BASE_URL}/connect/token`;
async function getAccessToken(): Promise<string | null> {
const tokenRequestData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: SOLO_CLIENT_ID || '',
client_secret: SOLO_CLIENT_SECRET || ''
});
try {
const response = await axios.post(TOKEN_ENDPOINT, tokenRequestData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
});
if (response.status === 200) {
return response.data.access_token;
} else {
console.error('Error retrieving token:', response.status, response.statusText);
return null;
}
} catch (error) {
console.error('Error retrieving token:', error);
return null;
}
}
async function callGenerateIssuerContacts(accessToken: string): Promise<void> {
const apiEndpoint = `${BASE_URL}/api/v1/Report/GenerateIssuerContacts`;
try {
const requestBody = { customerIssuerId: 1, contactStatus: "All", isPDF: true };
const response = await axios.post(apiEndpoint, requestBody, {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
console.log(JSON.stringify(response.data, null, 2));
} catch (error) {
console.error('Error calling API:', error);
}
}
async function main(): Promise<void> {
if (!SOLO_CLIENT_ID || !SOLO_CLIENT_SECRET) {
console.error('Please set SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables');
return;
}
const accessToken = await getAccessToken();
if (accessToken) {
await callGenerateIssuerContacts(accessToken);
} else {
console.error('Failed to obtain access token');
}
}
main();
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateIssuerContacts';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"contactStatus": "All",
"isPDF": true
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
200 Response:
{
"downloadUrl": "{{baseurl}}/Api/v1/Report/DownloadReport/CfDJ8G2a_F-j-rtGiUBjbT5isV3TVlIlVToEtV9JxVsr60VJ9LfP5N-Z8ixV--kX5sZDx4gQ5fAgbThffG-65kc1nf5i_KVCvU6NNdySDDC5F25-DwAmpOTu1fbUiKFjjMHDX7FSMT-tz7D0L2jLoKocuXGltF18Zi7gCCFuQjtNUliv/issuer-contacts.pdf/CfDJ8G2a_F-j-rtGiUBjbT5isV0VroFVLDVFwKMNCcIMM3Bk2Au3I7Em45KWbeNXzi4A4NWbnRFYwBm5U3P8HMm8jPZSuHIKOtHqYHrZhAZ-vnxNJt136Oc_VVMPgNaiFSM_rTBjrd5S3InvFcm6BKJhANs"
}
POST Report/GenerateMailingLabels#
Description:
Generates mailing labels for an Issuer.
Request Body:
Note
Refer to the Expanded Attributes and Options page for more info on securityType options.
All = Restricted and Non-Restricted.
Restricted = Restricted Shares.
NonRestricted = Non-Restricted Shares.
All = All Certificates.
Outstanding = Outstanding Shares.
Canceled = Canceled Shares.
Example Request:✓
curl --silent --location --request POST '{{baseurl}}/api/v1/Report/GenerateMailingLabels' \
--header 'Authorization: Bearer <YOUR TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"customerIssuerId": 1,
"isPDF": true
}'
#!/bin/bash
# Retrieve credentials from environment variables
CLIENT_ID="${SOLO_CLIENT_ID}"
CLIENT_SECRET="${SOLO_CLIENT_SECRET}"
# Check if credentials are set
if [ -z "$CLIENT_ID" ] || [ -z "$CLIENT_SECRET" ]; then
echo "Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set"
exit 1
fi
# Define the OAuth2 Token Endpoint
TOKEN_ENDPOINT="{{baseurl}}/connect/token"
# Prepare and make the token request
TOKEN_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$TOKEN_ENDPOINT" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=$CLIENT_ID" \
-d "client_secret=$CLIENT_SECRET")
# Extract HTTP status code and response body
HTTP_STATUS=$(echo "$TOKEN_RESPONSE" | tail -n 1)
RESPONSE_BODY=$(echo "$TOKEN_RESPONSE" | sed '$d')
# Handle the token response
if [ "$HTTP_STATUS" -eq 200 ]; then
# Extract the access token from the response
ACCESS_TOKEN=$(echo "$RESPONSE_BODY" | grep -o '"access_token":"[^"]*"' | cut -d'"' -f4)
if [ -z "$ACCESS_TOKEN" ]; then
echo "Error: Failed to extract access token from response"
exit 1
fi
echo "Successfully obtained access token"
else
echo "Error: Failed to obtain access token. HTTP Status: $HTTP_STATUS"
echo "Response: $RESPONSE_BODY"
exit 1
fi
# Define the API endpoint
API_ENDPOINT="{{baseurl}}/api/v1/Report/GenerateMailingLabels"
# Make the API request
API_RESPONSE=$(curl -s -X POST "$API_ENDPOINT" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"customerIssuerId": 1,
"isPDF": true
}')
# Print the JSON response from the API
echo "API Response:"
echo "$API_RESPONSE"
import os
import requests
# Set up environment variables
client_id = os.environ.get("SOLO_CLIENT_ID")
client_secret = os.environ.get("SOLO_CLIENT_SECRET")
# Define the OAuth2 Token Endpoint
token_endpoint = "{{baseurl}}/connect/token"
# Prepare the Token Request Data
token_data = {
"grant_type": "client_credentials",
"client_id": client_id,
"client_secret": client_secret
}
# Make a POST Request to get token
token_response = requests.post(token_endpoint, data=token_data)
# Handle the Response
if token_response.status_code == 200:
access_token = token_response.json().get("access_token")
# Make the API Request
api_url = "{{baseurl}}/api/v1/Report/GenerateMailingLabels"
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
data = {
"customerIssuerId": 1,
"isPDF": True,
}
api_response = requests.post(api_url, headers=headers, json=data)
# Print the Response
print(api_response.json())
else:
print(f"Error retrieving token: {token_response.status_code} - {token_response.text}")
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
// Set up environment variables
string clientId = Environment.GetEnvironmentVariable("SOLO_CLIENT_ID");
string clientSecret = Environment.GetEnvironmentVariable("SOLO_CLIENT_SECRET");
if (string.IsNullOrEmpty(clientId) || string.IsNullOrEmpty(clientSecret))
{
Console.WriteLine("Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set.");
return;
}
// Define the OAuth2 token endpoint
string tokenEndpoint = "{{baseurl}}/connect/token";
using HttpClient httpClient = new HttpClient();
// Prepare the token request data
var tokenRequestData = new Dictionary<string, string>
{
{ "grant_type", "client_credentials" },
{ "client_id", clientId },
{ "client_secret", clientSecret }
};
// Make a POST request to get token
var tokenRequestContent = new FormUrlEncodedContent(tokenRequestData);
HttpResponseMessage tokenResponse = await httpClient.PostAsync(tokenEndpoint, tokenRequestContent);
string accessToken = null;
// Handle the response
if (tokenResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
string tokenResponseBody = await tokenResponse.Content.ReadAsStringAsync();
JsonDocument tokenJson = JsonDocument.Parse(tokenResponseBody);
accessToken = tokenJson.RootElement.GetProperty("access_token").GetString();
}
else
{
Console.WriteLine($"Error retrieving token: {tokenResponse.StatusCode}");
string errorBody = await tokenResponse.Content.ReadAsStringAsync();
Console.WriteLine(errorBody);
return;
}
// Make the API request
string apiEndpoint = "{{baseurl}}/api/v1/Report/GenerateMailingLabels";
var requestBody = new { customerIssuerId = 1, isPDF = true };
var jsonContent = new StringContent(
JsonSerializer.Serialize(requestBody),
Encoding.UTF8,
"application/json");
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
HttpResponseMessage apiResponse = await httpClient.PostAsync(apiEndpoint, jsonContent);
// Print the response
string apiResponseBody = await apiResponse.Content.ReadAsStringAsync();
if (apiResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
JsonDocument jsonResponse = JsonDocument.Parse(apiResponseBody);
string formattedJson = JsonSerializer.Serialize(jsonResponse, new JsonSerializerOptions { WriteIndented = true });
Console.WriteLine(formattedJson);
}
else
{
Console.WriteLine($"API Error: {apiResponse.StatusCode}");
Console.WriteLine(apiResponseBody);
}
}
}
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateMailingLabels';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"isPDF": true
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
import axios from 'axios';
const SOLO_CLIENT_ID = process.env.SOLO_CLIENT_ID;
const SOLO_CLIENT_SECRET = process.env.SOLO_CLIENT_SECRET;
const BASE_URL = '{{baseurl}}';
const TOKEN_ENDPOINT = `${BASE_URL}/connect/token`;
async function getAccessToken(): Promise<string | null> {
const tokenRequestData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: SOLO_CLIENT_ID || '',
client_secret: SOLO_CLIENT_SECRET || ''
});
try {
const response = await axios.post(TOKEN_ENDPOINT, tokenRequestData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
});
if (response.status === 200) {
return response.data.access_token;
} else {
console.error('Error retrieving token:', response.status, response.statusText);
return null;
}
} catch (error) {
console.error('Error retrieving token:', error);
return null;
}
}
async function callGenerateMailingLabels(accessToken: string): Promise<void> {
const apiEndpoint = `${BASE_URL}/api/v1/Report/GenerateMailingLabels`;
try {
const requestBody = { customerIssuerId: 1, isPDF: true };
const response = await axios.post(apiEndpoint, requestBody, {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
console.log(JSON.stringify(response.data, null, 2));
} catch (error) {
console.error('Error calling API:', error);
}
}
async function main(): Promise<void> {
if (!SOLO_CLIENT_ID || !SOLO_CLIENT_SECRET) {
console.error('Please set SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables');
return;
}
const accessToken = await getAccessToken();
if (accessToken) {
await callGenerateMailingLabels(accessToken);
} else {
console.error('Failed to obtain access token');
}
}
main();
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateMailingLabels';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"isPDF": true
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
200 Response:
{
"downloadUrl": "{{baseurl}}/Api/v1/Report/DownloadReport/CfDJ8G2a_F-j-rtGiUBjbT5isV01DSiZEIqd_29RmVlRL0HmNCbrPj6lxxf1SQ9Ki1OSNSrTrU-BrZ6z2_kHAeQ9hTm2hzDbhpTErXLntnxsRSzaz3xl53MMQ1lARAWQRZ-kYbKjYXeSQy5lWUZUGUpRPEGWreT8VEBrHPFSSqg1gfEe/mailing-labels.pdf/CfDJ8G2a_F-j-rtGiUBjbT5isV0QQLTel3EF5cxAHqNaPc4MIZdt6PIL1Y9yqTaULcnfYu_6yiOGWYy-MZ_Vu7g81l_oc6h27t0b2PDzia4LxK_hS2XsZzaWFoG51sDTlGF3lcF7xqRfABVh8UzBQ4YTbzg"
}
POST Report/Generate/Issuer/Balance#
Description:
Generates an Issuer Balance report showing share counts by security type as of a specific date.
Request Body:
yyyy-mm-dd
format (Year-Month-Day)
Blank = All Securities.
C = Common Securities.
P = Preferred Securities.
Blank = No series specified.
A = Series A.
B = Series B.
C = Series C.
Note
Refer to the Expanded Attributes and Options page for more info on securityType options.
All = Restricted and Non-Restricted.
Restricted = Restricted Shares.
NonRestricted = Non-Restricted Shares.
Example Request:✓
curl --silent --location --request POST '{{baseurl}}/api/v1/Report/GenerateIssuerBalance' \
--header 'Authorization: Bearer <YOUR TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"customerIssuerId": 1,
"isPDF": true
}'
#!/bin/bash
# Retrieve credentials from environment variables
CLIENT_ID="${SOLO_CLIENT_ID}"
CLIENT_SECRET="${SOLO_CLIENT_SECRET}"
# Check if credentials are set
if [ -z "$CLIENT_ID" ] || [ -z "$CLIENT_SECRET" ]; then
echo "Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set"
exit 1
fi
# Define the OAuth2 Token Endpoint
TOKEN_ENDPOINT="{{baseurl}}/connect/token"
# Prepare and make the token request
TOKEN_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$TOKEN_ENDPOINT" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=$CLIENT_ID" \
-d "client_secret=$CLIENT_SECRET")
# Extract HTTP status code and response body
HTTP_STATUS=$(echo "$TOKEN_RESPONSE" | tail -n 1)
RESPONSE_BODY=$(echo "$TOKEN_RESPONSE" | sed '$d')
# Handle the token response
if [ "$HTTP_STATUS" -eq 200 ]; then
# Extract the access token from the response
ACCESS_TOKEN=$(echo "$RESPONSE_BODY" | grep -o '"access_token":"[^"]*"' | cut -d'"' -f4)
if [ -z "$ACCESS_TOKEN" ]; then
echo "Error: Failed to extract access token from response"
exit 1
fi
echo "Successfully obtained access token"
else
echo "Error: Failed to obtain access token. HTTP Status: $HTTP_STATUS"
echo "Response: $RESPONSE_BODY"
exit 1
fi
# Define the API endpoint
API_ENDPOINT="{{baseurl}}/api/v1/Report/GenerateIssuerBalance"
# Make the API request
API_RESPONSE=$(curl -s -X POST "$API_ENDPOINT" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"customerIssuerId": 1,
"isPDF": true
}')
# Print the JSON response from the API
echo "API Response:"
echo "$API_RESPONSE"
import os
import requests
# Set up environment variables
client_id = os.environ.get("SOLO_CLIENT_ID")
client_secret = os.environ.get("SOLO_CLIENT_SECRET")
# Define the OAuth2 Token Endpoint
token_endpoint = "{{baseurl}}/connect/token"
# Prepare the Token Request Data
token_data = {
"grant_type": "client_credentials",
"client_id": client_id,
"client_secret": client_secret
}
# Make a POST Request to get token
token_response = requests.post(token_endpoint, data=token_data)
# Handle the Response
if token_response.status_code == 200:
access_token = token_response.json().get("access_token")
# Make the API Request
api_url = "{{baseurl}}/api/v1/Report/GenerateIssuerBalance"
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
data = {
"customerIssuerId": 1,
"isPDF": True,
}
api_response = requests.post(api_url, headers=headers, json=data)
# Print the Response
print(api_response.json())
else:
print(f"Error retrieving token: {token_response.status_code} - {token_response.text}")
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
// Set up environment variables
string clientId = Environment.GetEnvironmentVariable("SOLO_CLIENT_ID");
string clientSecret = Environment.GetEnvironmentVariable("SOLO_CLIENT_SECRET");
if (string.IsNullOrEmpty(clientId) || string.IsNullOrEmpty(clientSecret))
{
Console.WriteLine("Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set.");
return;
}
// Define the OAuth2 token endpoint
string tokenEndpoint = "{{baseurl}}/connect/token";
using HttpClient httpClient = new HttpClient();
// Prepare the token request data
var tokenRequestData = new Dictionary<string, string>
{
{ "grant_type", "client_credentials" },
{ "client_id", clientId },
{ "client_secret", clientSecret }
};
// Make a POST request to get token
var tokenRequestContent = new FormUrlEncodedContent(tokenRequestData);
HttpResponseMessage tokenResponse = await httpClient.PostAsync(tokenEndpoint, tokenRequestContent);
string accessToken = null;
// Handle the response
if (tokenResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
string tokenResponseBody = await tokenResponse.Content.ReadAsStringAsync();
JsonDocument tokenJson = JsonDocument.Parse(tokenResponseBody);
accessToken = tokenJson.RootElement.GetProperty("access_token").GetString();
}
else
{
Console.WriteLine($"Error retrieving token: {tokenResponse.StatusCode}");
string errorBody = await tokenResponse.Content.ReadAsStringAsync();
Console.WriteLine(errorBody);
return;
}
// Make the API request
string apiEndpoint = "{{baseurl}}/api/v1/Report/GenerateIssuerBalance";
var requestBody = new { customerIssuerId = 1, isPDF = true };
var jsonContent = new StringContent(
JsonSerializer.Serialize(requestBody),
Encoding.UTF8,
"application/json");
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
HttpResponseMessage apiResponse = await httpClient.PostAsync(apiEndpoint, jsonContent);
// Print the response
string apiResponseBody = await apiResponse.Content.ReadAsStringAsync();
if (apiResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
JsonDocument jsonResponse = JsonDocument.Parse(apiResponseBody);
string formattedJson = JsonSerializer.Serialize(jsonResponse, new JsonSerializerOptions { WriteIndented = true });
Console.WriteLine(formattedJson);
}
else
{
Console.WriteLine($"API Error: {apiResponse.StatusCode}");
Console.WriteLine(apiResponseBody);
}
}
}
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateIssuerBalance';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"isPDF": true
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
import axios from 'axios';
const SOLO_CLIENT_ID = process.env.SOLO_CLIENT_ID;
const SOLO_CLIENT_SECRET = process.env.SOLO_CLIENT_SECRET;
const BASE_URL = '{{baseurl}}';
const TOKEN_ENDPOINT = `${BASE_URL}/connect/token`;
async function getAccessToken(): Promise<string | null> {
const tokenRequestData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: SOLO_CLIENT_ID || '',
client_secret: SOLO_CLIENT_SECRET || ''
});
try {
const response = await axios.post(TOKEN_ENDPOINT, tokenRequestData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
});
if (response.status === 200) {
return response.data.access_token;
} else {
console.error('Error retrieving token:', response.status, response.statusText);
return null;
}
} catch (error) {
console.error('Error retrieving token:', error);
return null;
}
}
async function callGenerateIssuerBalance(accessToken: string): Promise<void> {
const apiEndpoint = `${BASE_URL}/api/v1/Report/GenerateIssuerBalance`;
try {
const requestBody = { customerIssuerId: 1, isPDF: true };
const response = await axios.post(apiEndpoint, requestBody, {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
console.log(JSON.stringify(response.data, null, 2));
} catch (error) {
console.error('Error calling API:', error);
}
}
async function main(): Promise<void> {
if (!SOLO_CLIENT_ID || !SOLO_CLIENT_SECRET) {
console.error('Please set SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables');
return;
}
const accessToken = await getAccessToken();
if (accessToken) {
await callGenerateIssuerBalance(accessToken);
} else {
console.error('Failed to obtain access token');
}
}
main();
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateIssuerBalance';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"isPDF": true
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
200 Response:
{
"downloadUrl": "{{baseurl}}/Api/v1/Report/DownloadReport/[fileCode]/issuer-balance.pdf/[accessCode]"
}
POST Report/Generate/Ownership/Percentage#
Description:
Generates an Ownership Percentage report showing shareholder ownership percentages by security type.
Request Body:
Blank = All Securities.
C = Common Securities.
P = Preferred Securities.
Blank = No series specified.
A = Series A.
B = Series B.
C = Series C.
Note
Refer to the Expanded Attributes and Options page for more info on securityType options.
Example Request:✓
curl --silent --location --request POST '{{baseurl}}/api/v1/Report/GenerateOwnershipPercentage' \
--header 'Authorization: Bearer <YOUR TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"customerIssuerId": 1,
"isPDF": true
}'
#!/bin/bash
# Retrieve credentials from environment variables
CLIENT_ID="${SOLO_CLIENT_ID}"
CLIENT_SECRET="${SOLO_CLIENT_SECRET}"
# Check if credentials are set
if [ -z "$CLIENT_ID" ] || [ -z "$CLIENT_SECRET" ]; then
echo "Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set"
exit 1
fi
# Define the OAuth2 Token Endpoint
TOKEN_ENDPOINT="{{baseurl}}/connect/token"
# Prepare and make the token request
TOKEN_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$TOKEN_ENDPOINT" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=$CLIENT_ID" \
-d "client_secret=$CLIENT_SECRET")
# Extract HTTP status code and response body
HTTP_STATUS=$(echo "$TOKEN_RESPONSE" | tail -n 1)
RESPONSE_BODY=$(echo "$TOKEN_RESPONSE" | sed '$d')
# Handle the token response
if [ "$HTTP_STATUS" -eq 200 ]; then
# Extract the access token from the response
ACCESS_TOKEN=$(echo "$RESPONSE_BODY" | grep -o '"access_token":"[^"]*"' | cut -d'"' -f4)
if [ -z "$ACCESS_TOKEN" ]; then
echo "Error: Failed to extract access token from response"
exit 1
fi
echo "Successfully obtained access token"
else
echo "Error: Failed to obtain access token. HTTP Status: $HTTP_STATUS"
echo "Response: $RESPONSE_BODY"
exit 1
fi
# Define the API endpoint
API_ENDPOINT="{{baseurl}}/api/v1/Report/GenerateOwnershipPercentage"
# Make the API request
API_RESPONSE=$(curl -s -X POST "$API_ENDPOINT" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"customerIssuerId": 1,
"isPDF": true
}')
# Print the JSON response from the API
echo "API Response:"
echo "$API_RESPONSE"
import os
import requests
# Set up environment variables
client_id = os.environ.get("SOLO_CLIENT_ID")
client_secret = os.environ.get("SOLO_CLIENT_SECRET")
# Define the OAuth2 Token Endpoint
token_endpoint = "{{baseurl}}/connect/token"
# Prepare the Token Request Data
token_data = {
"grant_type": "client_credentials",
"client_id": client_id,
"client_secret": client_secret
}
# Make a POST Request to get token
token_response = requests.post(token_endpoint, data=token_data)
# Handle the Response
if token_response.status_code == 200:
access_token = token_response.json().get("access_token")
# Make the API Request
api_url = "{{baseurl}}/api/v1/Report/GenerateOwnershipPercentage"
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
data = {
"customerIssuerId": 1,
"isPDF": True,
}
api_response = requests.post(api_url, headers=headers, json=data)
# Print the Response
print(api_response.json())
else:
print(f"Error retrieving token: {token_response.status_code} - {token_response.text}")
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
// Set up environment variables
string clientId = Environment.GetEnvironmentVariable("SOLO_CLIENT_ID");
string clientSecret = Environment.GetEnvironmentVariable("SOLO_CLIENT_SECRET");
if (string.IsNullOrEmpty(clientId) || string.IsNullOrEmpty(clientSecret))
{
Console.WriteLine("Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set.");
return;
}
// Define the OAuth2 token endpoint
string tokenEndpoint = "{{baseurl}}/connect/token";
using HttpClient httpClient = new HttpClient();
// Prepare the token request data
var tokenRequestData = new Dictionary<string, string>
{
{ "grant_type", "client_credentials" },
{ "client_id", clientId },
{ "client_secret", clientSecret }
};
// Make a POST request to get token
var tokenRequestContent = new FormUrlEncodedContent(tokenRequestData);
HttpResponseMessage tokenResponse = await httpClient.PostAsync(tokenEndpoint, tokenRequestContent);
string accessToken = null;
// Handle the response
if (tokenResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
string tokenResponseBody = await tokenResponse.Content.ReadAsStringAsync();
JsonDocument tokenJson = JsonDocument.Parse(tokenResponseBody);
accessToken = tokenJson.RootElement.GetProperty("access_token").GetString();
}
else
{
Console.WriteLine($"Error retrieving token: {tokenResponse.StatusCode}");
string errorBody = await tokenResponse.Content.ReadAsStringAsync();
Console.WriteLine(errorBody);
return;
}
// Make the API request
string apiEndpoint = "{{baseurl}}/api/v1/Report/GenerateOwnershipPercentage";
var requestBody = new { customerIssuerId = 1, isPDF = true };
var jsonContent = new StringContent(
JsonSerializer.Serialize(requestBody),
Encoding.UTF8,
"application/json");
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
HttpResponseMessage apiResponse = await httpClient.PostAsync(apiEndpoint, jsonContent);
// Print the response
string apiResponseBody = await apiResponse.Content.ReadAsStringAsync();
if (apiResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
JsonDocument jsonResponse = JsonDocument.Parse(apiResponseBody);
string formattedJson = JsonSerializer.Serialize(jsonResponse, new JsonSerializerOptions { WriteIndented = true });
Console.WriteLine(formattedJson);
}
else
{
Console.WriteLine($"API Error: {apiResponse.StatusCode}");
Console.WriteLine(apiResponseBody);
}
}
}
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateOwnershipPercentage';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"isPDF": true
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
import axios from 'axios';
const SOLO_CLIENT_ID = process.env.SOLO_CLIENT_ID;
const SOLO_CLIENT_SECRET = process.env.SOLO_CLIENT_SECRET;
const BASE_URL = '{{baseurl}}';
const TOKEN_ENDPOINT = `${BASE_URL}/connect/token`;
async function getAccessToken(): Promise<string | null> {
const tokenRequestData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: SOLO_CLIENT_ID || '',
client_secret: SOLO_CLIENT_SECRET || ''
});
try {
const response = await axios.post(TOKEN_ENDPOINT, tokenRequestData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
});
if (response.status === 200) {
return response.data.access_token;
} else {
console.error('Error retrieving token:', response.status, response.statusText);
return null;
}
} catch (error) {
console.error('Error retrieving token:', error);
return null;
}
}
async function callGenerateOwnershipPercentage(accessToken: string): Promise<void> {
const apiEndpoint = `${BASE_URL}/api/v1/Report/GenerateOwnershipPercentage`;
try {
const requestBody = { customerIssuerId: 1, isPDF: true };
const response = await axios.post(apiEndpoint, requestBody, {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
console.log(JSON.stringify(response.data, null, 2));
} catch (error) {
console.error('Error calling API:', error);
}
}
async function main(): Promise<void> {
if (!SOLO_CLIENT_ID || !SOLO_CLIENT_SECRET) {
console.error('Please set SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables');
return;
}
const accessToken = await getAccessToken();
if (accessToken) {
await callGenerateOwnershipPercentage(accessToken);
} else {
console.error('Failed to obtain access token');
}
}
main();
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateOwnershipPercentage';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"isPDF": true
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
200 Response:
{
"downloadUrl": "{{baseurl}}/Api/v1/Report/DownloadReport/[fileCode]/ownership-percentage.pdf/[accessCode]"
}
POST Report/Generate/Transaction/List#
Description:
Generates a Transaction List report showing all transactions for a specified date range.
Request Body:
Empty = All Transactions.
N = New Issuances.
T = Transfers.
C = Conversions.
R = Retirements.
F = Forward Split.
V = Reverse Split.
D = Dividends.
Example Request:✓
curl --silent --location --request POST '{{baseurl}}/api/v1/Report/GenerateTransactionList' \
--header 'Authorization: Bearer <YOUR TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"customerIssuerId": 1,
"isPDF": true
}'
#!/bin/bash
# Retrieve credentials from environment variables
CLIENT_ID="${SOLO_CLIENT_ID}"
CLIENT_SECRET="${SOLO_CLIENT_SECRET}"
# Check if credentials are set
if [ -z "$CLIENT_ID" ] || [ -z "$CLIENT_SECRET" ]; then
echo "Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set"
exit 1
fi
# Define the OAuth2 Token Endpoint
TOKEN_ENDPOINT="{{baseurl}}/connect/token"
# Prepare and make the token request
TOKEN_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$TOKEN_ENDPOINT" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=$CLIENT_ID" \
-d "client_secret=$CLIENT_SECRET")
# Extract HTTP status code and response body
HTTP_STATUS=$(echo "$TOKEN_RESPONSE" | tail -n 1)
RESPONSE_BODY=$(echo "$TOKEN_RESPONSE" | sed '$d')
# Handle the token response
if [ "$HTTP_STATUS" -eq 200 ]; then
# Extract the access token from the response
ACCESS_TOKEN=$(echo "$RESPONSE_BODY" | grep -o '"access_token":"[^"]*"' | cut -d'"' -f4)
if [ -z "$ACCESS_TOKEN" ]; then
echo "Error: Failed to extract access token from response"
exit 1
fi
echo "Successfully obtained access token"
else
echo "Error: Failed to obtain access token. HTTP Status: $HTTP_STATUS"
echo "Response: $RESPONSE_BODY"
exit 1
fi
# Define the API endpoint
API_ENDPOINT="{{baseurl}}/api/v1/Report/GenerateTransactionList"
# Make the API request
API_RESPONSE=$(curl -s -X POST "$API_ENDPOINT" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"customerIssuerId": 1,
"isPDF": true
}')
# Print the JSON response from the API
echo "API Response:"
echo "$API_RESPONSE"
import os
import requests
# Set up environment variables
client_id = os.environ.get("SOLO_CLIENT_ID")
client_secret = os.environ.get("SOLO_CLIENT_SECRET")
# Define the OAuth2 Token Endpoint
token_endpoint = "{{baseurl}}/connect/token"
# Prepare the Token Request Data
token_data = {
"grant_type": "client_credentials",
"client_id": client_id,
"client_secret": client_secret
}
# Make a POST Request to get token
token_response = requests.post(token_endpoint, data=token_data)
# Handle the Response
if token_response.status_code == 200:
access_token = token_response.json().get("access_token")
# Make the API Request
api_url = "{{baseurl}}/api/v1/Report/GenerateTransactionList"
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
data = {
"customerIssuerId": 1,
"isPDF": True,
}
api_response = requests.post(api_url, headers=headers, json=data)
# Print the Response
print(api_response.json())
else:
print(f"Error retrieving token: {token_response.status_code} - {token_response.text}")
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
// Set up environment variables
string clientId = Environment.GetEnvironmentVariable("SOLO_CLIENT_ID");
string clientSecret = Environment.GetEnvironmentVariable("SOLO_CLIENT_SECRET");
if (string.IsNullOrEmpty(clientId) || string.IsNullOrEmpty(clientSecret))
{
Console.WriteLine("Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set.");
return;
}
// Define the OAuth2 token endpoint
string tokenEndpoint = "{{baseurl}}/connect/token";
using HttpClient httpClient = new HttpClient();
// Prepare the token request data
var tokenRequestData = new Dictionary<string, string>
{
{ "grant_type", "client_credentials" },
{ "client_id", clientId },
{ "client_secret", clientSecret }
};
// Make a POST request to get token
var tokenRequestContent = new FormUrlEncodedContent(tokenRequestData);
HttpResponseMessage tokenResponse = await httpClient.PostAsync(tokenEndpoint, tokenRequestContent);
string accessToken = null;
// Handle the response
if (tokenResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
string tokenResponseBody = await tokenResponse.Content.ReadAsStringAsync();
JsonDocument tokenJson = JsonDocument.Parse(tokenResponseBody);
accessToken = tokenJson.RootElement.GetProperty("access_token").GetString();
}
else
{
Console.WriteLine($"Error retrieving token: {tokenResponse.StatusCode}");
string errorBody = await tokenResponse.Content.ReadAsStringAsync();
Console.WriteLine(errorBody);
return;
}
// Make the API request
string apiEndpoint = "{{baseurl}}/api/v1/Report/GenerateTransactionList";
var requestBody = new { customerIssuerId = 1, isPDF = true };
var jsonContent = new StringContent(
JsonSerializer.Serialize(requestBody),
Encoding.UTF8,
"application/json");
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
HttpResponseMessage apiResponse = await httpClient.PostAsync(apiEndpoint, jsonContent);
// Print the response
string apiResponseBody = await apiResponse.Content.ReadAsStringAsync();
if (apiResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
JsonDocument jsonResponse = JsonDocument.Parse(apiResponseBody);
string formattedJson = JsonSerializer.Serialize(jsonResponse, new JsonSerializerOptions { WriteIndented = true });
Console.WriteLine(formattedJson);
}
else
{
Console.WriteLine($"API Error: {apiResponse.StatusCode}");
Console.WriteLine(apiResponseBody);
}
}
}
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateTransactionList';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"isPDF": true
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
import axios from 'axios';
const SOLO_CLIENT_ID = process.env.SOLO_CLIENT_ID;
const SOLO_CLIENT_SECRET = process.env.SOLO_CLIENT_SECRET;
const BASE_URL = '{{baseurl}}';
const TOKEN_ENDPOINT = `${BASE_URL}/connect/token`;
async function getAccessToken(): Promise<string | null> {
const tokenRequestData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: SOLO_CLIENT_ID || '',
client_secret: SOLO_CLIENT_SECRET || ''
});
try {
const response = await axios.post(TOKEN_ENDPOINT, tokenRequestData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
});
if (response.status === 200) {
return response.data.access_token;
} else {
console.error('Error retrieving token:', response.status, response.statusText);
return null;
}
} catch (error) {
console.error('Error retrieving token:', error);
return null;
}
}
async function callGenerateTransactionList(accessToken: string): Promise<void> {
const apiEndpoint = `${BASE_URL}/api/v1/Report/GenerateTransactionList`;
try {
const requestBody = { customerIssuerId: 1, isPDF: true };
const response = await axios.post(apiEndpoint, requestBody, {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
console.log(JSON.stringify(response.data, null, 2));
} catch (error) {
console.error('Error calling API:', error);
}
}
async function main(): Promise<void> {
if (!SOLO_CLIENT_ID || !SOLO_CLIENT_SECRET) {
console.error('Please set SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables');
return;
}
const accessToken = await getAccessToken();
if (accessToken) {
await callGenerateTransactionList(accessToken);
} else {
console.error('Failed to obtain access token');
}
}
main();
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateTransactionList';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"isPDF": true
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
200 Response (when ReturnJSON is true):
{
"totalTransactionRecords": 1,
"transactions": [
{
"controlTransactionId": 1242412,
"TransactionNumber": 1242,
"InvoiceNumber": 232,
"Agent": "Name of person submitted transaction",
"processDate": "2025-02-02",
"effectiveDate": "2025-01-02",
"issuerName": "Demo Company",
"customerIssuerId": 2322,
"controlIssuerId": 23421,
"type": "New Issuance",
"typeCode": "N",
"canceledCertificates": [
{
"shareholderName": "John Doe",
"shareholderType": "Individual Retirement Account",
"shareholderTypeEnum": "IRA", // New
"shareholderCustomerId": "435345E",
"shareholderControlId": 14254124,
"primaryAddress": {
"address1": "23 Demo Street",
"address2": "",
"city": "Portland",
"state": "OR",
"postalCode": "97214",
"country2Code": "US",
"email": "johndoe@email.com",
"phone": "(333)333-3333",
"secondaryPhone": "",
"country": "United States"
},
"securityTypeId": 1,
"securityType": "Common",
"issuedDate": "2025-01-02",
"controlCertificateId": 1234687, // New
"customerCertificateId": null, // New
"certificateNumber": "Book-2342",
"restriction": "No Restriction",
"shares": 100,
"value": 200
}
],
"issuedCertificates": [
{
"shareholderName": "Jame Doe & Lisa Doe",
"shareholderType": "Joint Tenant",
"shareholderTypeEnum": "JointTenant", // New
"shareholderCustomerId": "326522E",
"shareholderControlId": 235262,
"primaryAddress": {
"address1": "467 Start Demo Street",
"address2": "",
"city": "Portland",
"state": "OR",
"postalCode": "97214",
"country2Code": "US",
"email": "jamedoe@email.com",
"phone": "(333)4444-3333",
"secondaryPhone": "",
"country": "United States"
},
"securityTypeId": 1,
"securityType": "Common",
"issuedDate": "2025-01-02",
"controlCertificateId": 465644, // New
"customerCertificateId": null, // New
"certificateNumber": "Book-2346",
"restriction": "No Restriction",
"shares": 100,
"value": 200
}
]
}
]
}
200 Response (when IsPDF is true):
{
"downloadUrl": "{{baseurl}}/Api/v1/Report/DownloadReport/[fileCode]/transaction-list.pdf/[accessCode]"
}
POST Report/Generate/Control/Book#
Description:
Generates a Control Book report for a specified date range.
Request Body:
Example Request:✓
curl --silent --location --request POST '{{baseurl}}/api/v1/Report/GenerateControlBook' \
--header 'Authorization: Bearer <YOUR TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"customerIssuerId": 1,
"isPDF": true
}'
#!/bin/bash
# Retrieve credentials from environment variables
CLIENT_ID="${SOLO_CLIENT_ID}"
CLIENT_SECRET="${SOLO_CLIENT_SECRET}"
# Check if credentials are set
if [ -z "$CLIENT_ID" ] || [ -z "$CLIENT_SECRET" ]; then
echo "Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set"
exit 1
fi
# Define the OAuth2 Token Endpoint
TOKEN_ENDPOINT="{{baseurl}}/connect/token"
# Prepare and make the token request
TOKEN_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$TOKEN_ENDPOINT" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=$CLIENT_ID" \
-d "client_secret=$CLIENT_SECRET")
# Extract HTTP status code and response body
HTTP_STATUS=$(echo "$TOKEN_RESPONSE" | tail -n 1)
RESPONSE_BODY=$(echo "$TOKEN_RESPONSE" | sed '$d')
# Handle the token response
if [ "$HTTP_STATUS" -eq 200 ]; then
# Extract the access token from the response
ACCESS_TOKEN=$(echo "$RESPONSE_BODY" | grep -o '"access_token":"[^"]*"' | cut -d'"' -f4)
if [ -z "$ACCESS_TOKEN" ]; then
echo "Error: Failed to extract access token from response"
exit 1
fi
echo "Successfully obtained access token"
else
echo "Error: Failed to obtain access token. HTTP Status: $HTTP_STATUS"
echo "Response: $RESPONSE_BODY"
exit 1
fi
# Define the API endpoint
API_ENDPOINT="{{baseurl}}/api/v1/Report/GenerateControlBook"
# Make the API request
API_RESPONSE=$(curl -s -X POST "$API_ENDPOINT" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"customerIssuerId": 1,
"isPDF": true
}')
# Print the JSON response from the API
echo "API Response:"
echo "$API_RESPONSE"
import os
import requests
# Set up environment variables
client_id = os.environ.get("SOLO_CLIENT_ID")
client_secret = os.environ.get("SOLO_CLIENT_SECRET")
# Define the OAuth2 Token Endpoint
token_endpoint = "{{baseurl}}/connect/token"
# Prepare the Token Request Data
token_data = {
"grant_type": "client_credentials",
"client_id": client_id,
"client_secret": client_secret
}
# Make a POST Request to get token
token_response = requests.post(token_endpoint, data=token_data)
# Handle the Response
if token_response.status_code == 200:
access_token = token_response.json().get("access_token")
# Make the API Request
api_url = "{{baseurl}}/api/v1/Report/GenerateControlBook"
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
data = {
"customerIssuerId": 1,
"isPDF": True,
}
api_response = requests.post(api_url, headers=headers, json=data)
# Print the Response
print(api_response.json())
else:
print(f"Error retrieving token: {token_response.status_code} - {token_response.text}")
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
// Set up environment variables
string clientId = Environment.GetEnvironmentVariable("SOLO_CLIENT_ID");
string clientSecret = Environment.GetEnvironmentVariable("SOLO_CLIENT_SECRET");
if (string.IsNullOrEmpty(clientId) || string.IsNullOrEmpty(clientSecret))
{
Console.WriteLine("Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set.");
return;
}
// Define the OAuth2 token endpoint
string tokenEndpoint = "{{baseurl}}/connect/token";
using HttpClient httpClient = new HttpClient();
// Prepare the token request data
var tokenRequestData = new Dictionary<string, string>
{
{ "grant_type", "client_credentials" },
{ "client_id", clientId },
{ "client_secret", clientSecret }
};
// Make a POST request to get token
var tokenRequestContent = new FormUrlEncodedContent(tokenRequestData);
HttpResponseMessage tokenResponse = await httpClient.PostAsync(tokenEndpoint, tokenRequestContent);
string accessToken = null;
// Handle the response
if (tokenResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
string tokenResponseBody = await tokenResponse.Content.ReadAsStringAsync();
JsonDocument tokenJson = JsonDocument.Parse(tokenResponseBody);
accessToken = tokenJson.RootElement.GetProperty("access_token").GetString();
}
else
{
Console.WriteLine($"Error retrieving token: {tokenResponse.StatusCode}");
string errorBody = await tokenResponse.Content.ReadAsStringAsync();
Console.WriteLine(errorBody);
return;
}
// Make the API request
string apiEndpoint = "{{baseurl}}/api/v1/Report/GenerateControlBook";
var requestBody = new { customerIssuerId = 1, isPDF = true };
var jsonContent = new StringContent(
JsonSerializer.Serialize(requestBody),
Encoding.UTF8,
"application/json");
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
HttpResponseMessage apiResponse = await httpClient.PostAsync(apiEndpoint, jsonContent);
// Print the response
string apiResponseBody = await apiResponse.Content.ReadAsStringAsync();
if (apiResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
JsonDocument jsonResponse = JsonDocument.Parse(apiResponseBody);
string formattedJson = JsonSerializer.Serialize(jsonResponse, new JsonSerializerOptions { WriteIndented = true });
Console.WriteLine(formattedJson);
}
else
{
Console.WriteLine($"API Error: {apiResponse.StatusCode}");
Console.WriteLine(apiResponseBody);
}
}
}
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateControlBook';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"isPDF": true
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
import axios from 'axios';
const SOLO_CLIENT_ID = process.env.SOLO_CLIENT_ID;
const SOLO_CLIENT_SECRET = process.env.SOLO_CLIENT_SECRET;
const BASE_URL = '{{baseurl}}';
const TOKEN_ENDPOINT = `${BASE_URL}/connect/token`;
async function getAccessToken(): Promise<string | null> {
const tokenRequestData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: SOLO_CLIENT_ID || '',
client_secret: SOLO_CLIENT_SECRET || ''
});
try {
const response = await axios.post(TOKEN_ENDPOINT, tokenRequestData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
});
if (response.status === 200) {
return response.data.access_token;
} else {
console.error('Error retrieving token:', response.status, response.statusText);
return null;
}
} catch (error) {
console.error('Error retrieving token:', error);
return null;
}
}
async function callGenerateControlBook(accessToken: string): Promise<void> {
const apiEndpoint = `${BASE_URL}/api/v1/Report/GenerateControlBook`;
try {
const requestBody = { customerIssuerId: 1, isPDF: true };
const response = await axios.post(apiEndpoint, requestBody, {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
console.log(JSON.stringify(response.data, null, 2));
} catch (error) {
console.error('Error calling API:', error);
}
}
async function main(): Promise<void> {
if (!SOLO_CLIENT_ID || !SOLO_CLIENT_SECRET) {
console.error('Please set SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables');
return;
}
const accessToken = await getAccessToken();
if (accessToken) {
await callGenerateControlBook(accessToken);
} else {
console.error('Failed to obtain access token');
}
}
main();
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/GenerateControlBook';
const requestBody = JSON.stringify({
"customerIssuerId": 1,
"isPDF": true
});
const apiOptions = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(requestBody)
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions, requestBody);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
200 Response:
{
"downloadUrl": "{{baseurl}}/Api/v1/Report/DownloadReport/[fileCode]/control-book.pdf/[accessCode]"
}
GET Report/DownloadReport/{fileCode}/{fileName}/{accessCode}#
Description:
Allows for the downloading of a report.
Query Parameters:
Example Request:✓
curl --silent --location '{{baseurl}}/api/v1/Report/DownloadReport/${FILE_CODE}/${FILE_NAME}/${ACCESS_CODE}?fileCode=abc123&fileName=report.pdf&accessCode=xyz789' \
--header 'Authorization: Bearer <YOUR TOKEN>'
#!/bin/bash
# Retrieve credentials from environment variables
CLIENT_ID="${SOLO_CLIENT_ID}"
CLIENT_SECRET="${SOLO_CLIENT_SECRET}"
# Check if credentials are set
if [ -z "$CLIENT_ID" ] || [ -z "$CLIENT_SECRET" ]; then
echo "Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set"
exit 1
fi
# Define the OAuth2 Token Endpoint
TOKEN_ENDPOINT="{{baseurl}}/connect/token"
# Prepare and make the token request
TOKEN_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST "$TOKEN_ENDPOINT" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=$CLIENT_ID" \
-d "client_secret=$CLIENT_SECRET")
# Extract HTTP status code and response body
HTTP_STATUS=$(echo "$TOKEN_RESPONSE" | tail -n 1)
RESPONSE_BODY=$(echo "$TOKEN_RESPONSE" | sed '$d')
# Handle the token response
if [ "$HTTP_STATUS" -eq 200 ]; then
# Extract the access token from the response
ACCESS_TOKEN=$(echo "$RESPONSE_BODY" | grep -o '"access_token":"[^"]*"' | cut -d'"' -f4)
if [ -z "$ACCESS_TOKEN" ]; then
echo "Error: Failed to extract access token from response"
exit 1
fi
echo "Successfully obtained access token"
else
echo "Error: Failed to obtain access token. HTTP Status: $HTTP_STATUS"
echo "Response: $RESPONSE_BODY"
exit 1
fi
# Define the API endpoint with path parameters
FILE_CODE="abc123"
FILE_NAME="report.pdf"
ACCESS_CODE="xyz789"
API_ENDPOINT="{{baseurl}}/api/v1/Report/DownloadReport/${FILE_CODE}/${FILE_NAME}/${ACCESS_CODE}"
# Make the API request
API_RESPONSE=$(curl -s -X GET "$API_ENDPOINT" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json")
# Print the response
echo "API Response:"
echo "$API_RESPONSE"
import os
import requests
# Set up environment variables
client_id = os.environ.get("SOLO_CLIENT_ID")
client_secret = os.environ.get("SOLO_CLIENT_SECRET")
# Define the OAuth2 Token Endpoint
token_endpoint = "{{baseurl}}/connect/token"
# Prepare the Token Request Data
token_data = {
"grant_type": "client_credentials",
"client_id": client_id,
"client_secret": client_secret
}
# Make a POST Request to get token
token_response = requests.post(token_endpoint, data=token_data)
# Handle the Response
if token_response.status_code == 200:
access_token = token_response.json().get("access_token")
# Make the API Request
api_url = "{{baseurl}}/api/v1/Report/DownloadReport/{fileCode}/{fileName}/{accessCode}"
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
params = {
"fileCode": "abc123",
"fileName": "report.pdf",
"accessCode": "xyz789",
}
api_response = requests.get(api_url, headers=headers, params=params)
# Print the Response
print(api_response.json())
else:
print(f"Error retrieving token: {token_response.status_code} - {token_response.text}")
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
class Program
{
static async Task Main(string[] args)
{
// Set up environment variables
string clientId = Environment.GetEnvironmentVariable("SOLO_CLIENT_ID");
string clientSecret = Environment.GetEnvironmentVariable("SOLO_CLIENT_SECRET");
if (string.IsNullOrEmpty(clientId) || string.IsNullOrEmpty(clientSecret))
{
Console.WriteLine("Error: SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables must be set.");
return;
}
// Define the OAuth2 token endpoint
string tokenEndpoint = "{{baseurl}}/connect/token";
using HttpClient httpClient = new HttpClient();
// Prepare the token request data
var tokenRequestData = new Dictionary<string, string>
{
{ "grant_type", "client_credentials" },
{ "client_id", clientId },
{ "client_secret", clientSecret }
};
// Make a POST request to get token
var tokenRequestContent = new FormUrlEncodedContent(tokenRequestData);
HttpResponseMessage tokenResponse = await httpClient.PostAsync(tokenEndpoint, tokenRequestContent);
string accessToken = null;
// Handle the response
if (tokenResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
string tokenResponseBody = await tokenResponse.Content.ReadAsStringAsync();
JsonDocument tokenJson = JsonDocument.Parse(tokenResponseBody);
accessToken = tokenJson.RootElement.GetProperty("access_token").GetString();
}
else
{
Console.WriteLine($"Error retrieving token: {tokenResponse.StatusCode}");
string errorBody = await tokenResponse.Content.ReadAsStringAsync();
Console.WriteLine(errorBody);
return;
}
// Make the API request
string apiEndpoint = "{{baseurl}}/api/v1/Report/DownloadReport/{fileCode}/{fileName}/{accessCode}?fileCode=abc123&fileName=report.pdf&accessCode=xyz789";
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage apiResponse = await httpClient.GetAsync(apiEndpoint);
// Print the response
string apiResponseBody = await apiResponse.Content.ReadAsStringAsync();
if (apiResponse.StatusCode == System.Net.HttpStatusCode.OK)
{
JsonDocument jsonResponse = JsonDocument.Parse(apiResponseBody);
string formattedJson = JsonSerializer.Serialize(jsonResponse, new JsonSerializerOptions { WriteIndented = true });
Console.WriteLine(formattedJson);
}
else
{
Console.WriteLine($"API Error: {apiResponse.StatusCode}");
Console.WriteLine(apiResponseBody);
}
}
}
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/DownloadReport/{fileCode}/{fileName}/{accessCode}?fileCode=abc123&fileName=report.pdf&accessCode=xyz789';
const apiOptions = {
method: 'GET',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
import axios from 'axios';
const SOLO_CLIENT_ID = process.env.SOLO_CLIENT_ID;
const SOLO_CLIENT_SECRET = process.env.SOLO_CLIENT_SECRET;
const BASE_URL = '{{baseurl}}';
const TOKEN_ENDPOINT = `${BASE_URL}/connect/token`;
async function getAccessToken(): Promise<string | null> {
const tokenRequestData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: SOLO_CLIENT_ID || '',
client_secret: SOLO_CLIENT_SECRET || ''
});
try {
const response = await axios.post(TOKEN_ENDPOINT, tokenRequestData, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
});
if (response.status === 200) {
return response.data.access_token;
} else {
console.error('Error retrieving token:', response.status, response.statusText);
return null;
}
} catch (error) {
console.error('Error retrieving token:', error);
return null;
}
}
async function callDownloadReport(accessToken: string): Promise<void> {
const apiEndpoint = `${BASE_URL}/api/v1/Report/DownloadReport/{fileCode}/{fileName}/{accessCode}`;
try {
const params = { fileCode: "abc123", fileName: "report.pdf", accessCode: "xyz789" };
const response = await axios.get(apiEndpoint, {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
},
params: params
});
console.log(JSON.stringify(response.data, null, 2));
} catch (error) {
console.error('Error calling API:', error);
}
}
async function main(): Promise<void> {
if (!SOLO_CLIENT_ID || !SOLO_CLIENT_SECRET) {
console.error('Please set SOLO_CLIENT_ID and SOLO_CLIENT_SECRET environment variables');
return;
}
const accessToken = await getAccessToken();
if (accessToken) {
await callDownloadReport(accessToken);
} else {
console.error('Failed to obtain access token');
}
}
main();
const https = require('https');
const http = require('http');
const { URL } = require('url');
// Retrieve credentials from environment variables
const clientId = process.env.SOLO_CLIENT_ID;
const clientSecret = process.env.SOLO_CLIENT_SECRET;
// Define the OAuth2 Token Endpoint
const tokenEndpoint = '{{baseurl}}/connect/token';
// Function to make HTTP requests
function makeRequest(url, options, postData = null) {
return new Promise((resolve, reject) => {
const parsedUrl = new URL(url);
const protocol = parsedUrl.protocol === 'https:' ? https : http;
const req = protocol.request(url, options, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
resolve({ statusCode: res.statusCode, body: data });
});
});
req.on('error', (error) => {
reject(error);
});
if (postData) {
req.write(postData);
}
req.end();
});
}
async function main() {
// Prepare the Token Request Data
const tokenData = new URLSearchParams({
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
}).toString();
// Make a POST request to get token
const tokenOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': Buffer.byteLength(tokenData)
}
};
try {
const tokenResponse = await makeRequest(tokenEndpoint, tokenOptions, tokenData);
// Handle the Response
if (tokenResponse.statusCode !== 200) {
console.error('Error getting token:', tokenResponse.body);
return;
}
const tokenJson = JSON.parse(tokenResponse.body);
const accessToken = tokenJson.access_token;
// Make the API Request
const apiUrl = '{{baseurl}}/api/v1/Report/DownloadReport/abc123/report.pdf/xyz789';
const apiOptions = {
method: 'GET',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
};
const apiResponse = await makeRequest(apiUrl, apiOptions);
// Print the Response
if (apiResponse.statusCode === 200) {
const responseJson = JSON.parse(apiResponse.body);
console.log(JSON.stringify(responseJson, null, 2));
} else {
console.error('API Error:', apiResponse.statusCode, apiResponse.body);
}
} catch (error) {
console.error('Request failed:', error.message);
}
}
main();
200 Response:
{
"downloadUrl": "{{baseurl}}/Api/v1/Report/DownloadReport/CfDJ8G2a_F-j-rtGiUBjbT5isV01DSiZEIqd_29RmVlRL0HmNCbrPj6lxxf1SQ9Ki1OSNSrTrU-BrZ6z2_kHAeQ9hTm2hzDbhpTErXLntnxsRSzaz3xl53MMQ1lARAWQRZ-kYbKjYXeSQy5lWUZUGUpRPEGWreT8VEBrHPFSSqg1gfEe/mailing-labels.pdf/CfDJ8G2a_F-j-rtGiUBjbT5isV0QQLTel3EF5cxAHqNaPc4MIZdt6PIL1Y9yqTaULcnfYu_6yiOGWYy-MZ_Vu7g81l_oc6h27t0b2PDzia4LxK_hS2XsZzaWFoG51sDTlGF3lcF7xqRfABVh8UzBQ4YTbzg"
}