uv-apimatic-sdk
v0.0.1
Published
Sample SDKs for UV by APIMatic
Readme
Getting Started with Upvest Investment API
Introduction
Upvest Investment API.
Install the Package
Run the following command from your project directory to install the package from npm:
npm install [email protected]For additional package details, see the Npm page for the [email protected] npm.
Initialize the API Client
Note: Documentation for the client can be found here.
The following parameters are configurable for the API Client:
| Parameter | Type | Description |
| --- | --- | --- |
| environment | Environment | The API environment. Default: Environment.Production |
| timeout | number | Timeout for API calls.Default: 30000 |
| httpClientOptions | Partial<HttpClientOptions> | Stable configurable http client options. |
| unstableHttpClientOptions | any | Unstable configurable http client options. |
| logging | PartialLoggingOptions | Logging Configuration to enable logging |
| clientCredentialsAuthCredentials | ClientCredentialsAuthCredentials | The credential object for clientCredentialsAuth |
| httpSignatureCredentials | HttpSignatureCredentials | The key material used to sign every request with an HTTP message signature |
The API client can be initialized as follows:
Code-Based Client Initialization
import { Client, Environment, LogLevel, OauthScope } from 'uv-apimatic-sdk';
const client = new Client({
clientCredentialsAuthCredentials: {
oauthClientId: 'OAuthClientId',
oauthClientSecret: 'OAuthClientSecret',
oauthScopes: [
OauthScope.Accountsread,
OauthScope.Accountsadmin
]
},
httpSignatureCredentials: {
keyId: 'KeyId',
privateKeyPath: '/path/to/upvest-http-sign-key.pem',
privateKeyPassphrase: 'PrivateKeyPassphrase'
},
timeout: 30000,
environment: Environment.Production,
logging: {
logLevel: LogLevel.Info,
logRequest: {
logBody: true
},
logResponse: {
logHeaders: true
}
},
});Configuration-Based Client Initialization
import * as path from 'path';
import * as fs from 'fs';
import { Client } from 'uv-apimatic-sdk';
// Provide absolute path for the configuration file
const absolutePath = path.resolve('./config.json');
// Read the configuration file content
const fileContent = fs.readFileSync(absolutePath, 'utf-8');
// Initialize client from JSON configuration content
const client = Client.fromJsonConfig(fileContent);See the Configuration-Based Client Initialization section for details.
Environment-Based Client Initialization
import * as dotenv from 'dotenv';
import * as path from 'path';
import * as fs from 'fs';
import { Client } from 'uv-apimatic-sdk';
// Optional - Provide absolute path for the .env file
const absolutePath = path.resolve('./.env');
if (fs.existsSync(absolutePath)) {
// Load environment variables from .env file
dotenv.config({ path: absolutePath, override: true });
}
// Initialize client using environment variables
const client = Client.fromEnvironment(process.env);See the Environment-Based Client Initialization section for details.
Environments
The SDK can be configured to use a different environment for making API calls. Available environments are:
Fields
| Name | Description | | --- | --- | | Production | Default Sandbox environment | | Environment2 | Live environment |
Authorization
This API uses the following authentication schemes.
HTTP Signatures
On top of the OAuth 2 token, every request to the Upvest Investment API has to
carry a cryptographic signature. The SDK creates it for you once you pass
httpSignatureCredentials to the client -- see
HTTP Signatures for details.
List of APIs
- Access Tokens
- Webhook Subscriptions
- User Identifiers
- User Checks
- Tax Exemptions
- Tax Wrappers
- Account Groups
- Reference Accounts
- Direct Debits
- Credit Fundings
- Cash Balance Transfers
- Virtual Bank Accounts
- Cash Balances
- Price Data
- Tax Residencies
- Fees Configurations
- Transaction Fees Models
- Portfolios Rebalancing
- Virtual Cash Balances
- Savings Plans
- Securities Transfers
- Account Transfers
- ISA Transfers
- Business Checks
- Files
- Users
- Accounts
- Mandates
- Top-Ups
- Withdrawals
- Instruments
- Orders
- Positions
- Reports
- Transactions
- Fees
- Portfolios
- Valuations
- Liquidations
- Returns
- Tests
- Businesses
- Roles
SDK Infrastructure
Configuration
- HttpClientOptions
- RetryConfiguration
- ProxySettings
- Configuration-Based Client Initialization
- Environment-Based Client Initialization
- PartialLoggingOptions
- PartialRequestLoggingOptions
- PartialResponseLoggingOptions
- LoggerInterface
