apimatic-ak-sdk
v0.0.1
Published
Test APIs from APIMatic to demonstrate the SDKs
Downloads
8
Readme
Getting Started with Akoya
Introduction
Akoya product APIs for data access. Default servers are set for the Akoya sandbox environment.
Akoya APIs include the following updates:
- v2.2.2
- Added mode query parameter to Account Information, Balances, Investments, and Transactions to support standard mode.
- Edited callouts for Account Holder endpoint
- v2.2.1
- Fixed typo in
accountIdsquery parameter for/accounts-info,/balances,/accounts - Added security method for
Account holder informationto bear token. Missing method defaulted to basic auth. - Added examples and descriptions to some schemas
- Added HTTP status
429FDX error1207.
- Fixed typo in
- v2.2 Additions
- Added optional
x-akoya-interaction-typeheader to all endpoints to specify if a request is part of a batch process - Update of tags to organize endpoints by Akoya product
206response added to/accounts-info,/balances,/accounts
- Added optional
- v2.1 New Statements product and Customers product updated with additional endpoint,
Account holder information. - v2.0 Launch of Akoya products: Account Info, Balances, Investments, Transactions, Payments, Customers.
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: 0 |
| httpClientOptions | Partial<HttpClientOptions> | Stable configurable http client options. |
| unstableHttpClientOptions | any | Unstable configurable http client options. |
| logging | PartialLoggingOptions | Logging Configuration to enable logging |
| basicAuthCredentials | BasicAuthCredentials | The credential object for basicAuth |
| bearerAuthCredentials | BearerAuthCredentials | The credential object for bearerAuth |
The API client can be initialized as follows:
Code-Based Client Initialization
import { Client, Environment, LogLevel } from 'apimatic-ak-sdk';
const client = new Client({
basicAuthCredentials: {
username: 'Username',
password: 'Password'
},
bearerAuthCredentials: {
accessToken: 'AccessToken'
},
timeout: 0,
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 'apimatic-ak-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 'apimatic-ak-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 server | | Environment2 | Products server |
Authorization
This API uses the following authentication schemes.
List of APIs
SDK Infrastructure
Configuration
- HttpClientOptions
- RetryConfiguration
- ProxySettings
- Configuration-Based Client Initialization
- Environment-Based Client Initialization
- PartialLoggingOptions
- PartialRequestLoggingOptions
- PartialResponseLoggingOptions
- LoggerInterface
