-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First cut at generating a new version of the wrapper library using code-gen tools.
- Loading branch information
1 parent
1f2b7a9
commit 31f176e
Showing
22 changed files
with
5,890 additions
and
1,846 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,42 @@ | ||
# MX Atrium | ||
[](http://badge.fury.io/js/mx-atrium) [](https://travis-ci.org/mxenabled/mx-atrium-node) | ||
# MX API | ||
The MX Atrium API supports over 48,000 data connections to thousands of financial institutions. It provides secure access to your users' accounts and transactions with industry-leading cleansing, categorization, and classification. Atrium is designed according to resource-oriented REST architecture and responds with JSON bodies and HTTP response codes. Use Atrium's development environment, vestibule.mx.com, to quickly get up and running. The development environment limits are 100 users, 25 members per user, and access to the top 15 institutions. Contact MX to purchase production access. | ||
|
||
## Description | ||
This is a Node wrapper for the [MX Atrium API](https://atrium.mx.com). It is intended to be used as a helper for the implementation of a proxy server. To get an API key and Client ID, [click here](https://atrium.mx.com/developers/sign_up). | ||
## Installation & Usage | ||
|
||
## Installation | ||
``` | ||
npm install mx-atrium | ||
### Install Required npm Packages | ||
```sh | ||
npm install request --save | ||
npm install bluebird --save | ||
npm install @types/node --save | ||
``` | ||
|
||
## Usage | ||
### Generate JavaScript file | ||
```sh | ||
tsc --target es5 api.ts | ||
``` | ||
const Atrium = require('mx-atrium'); | ||
|
||
const AtriumClient = new Atrium.Client('API_KEY', 'CLIENT_ID', Atrium.environments.sand); | ||
``` | ||
## Example Usage | ||
|
||
Sample Express.js route | ||
``` | ||
app.get('/institutions', (request, response) => { | ||
AtriumClient.listInstitutions(request) | ||
.then(json => { | ||
response.json(json); | ||
}); | ||
}); | ||
``` | ||
Please see `docs` directory for additional endpoint examples | ||
|
||
For a complete express.js server example, [click here](https://github.com/mxenabled/mx-atrium-express). | ||
```javascript | ||
var api = require('./api.js'); | ||
|
||
## Helpers | ||
var client = new api.AccountsApi(); | ||
|
||
There are two constants returned with the Atrium instance, `endpoints` and `environments`. | ||
client.setApiKey(0, "YOUR API-KEY"); | ||
client.setApiKey(1, "YOUR CLIENT-ID"); | ||
|
||
#### Atrium.environments | ||
This returns a `sand` and `production` URL that must be passed to the new client. | ||
var accountGuid = "accountGuid_example"; // string | The unique identifier for an `account`. | ||
var userGuid = "userGuid_example"; // string | The unique identifier for a `user`. | ||
var fromDate = "fromDate_example"; // string | Filter transactions from this date. (optional) | ||
var toDate = "toDate_example"; // string | Filter transactions to this date. (optional) | ||
var page = 12; // number | Specify current page. (optional) | ||
var recordsPerPage = 12; // number | Specify records per page. (optional) | ||
|
||
#### Atrium.endpoints | ||
This returns an array of objects that can be used to build routes for the server. | ||
var response = client.listAccountTransactions(accountGuid, userGuid, fromDate, toDate, page, recordsPerPage); | ||
|
||
Sample object | ||
``` | ||
{ | ||
method: 'post', | ||
url: '/users', | ||
clientMethod: 'createUser' | ||
} | ||
response.then(function(value) { | ||
console.log(value); | ||
}); | ||
``` |
Oops, something went wrong.