KapitalWise logo

Getting Started Edit

Welcome to KapitalWise Goal API.

This API document is designed for those interested in developing for KapitalWise platform.

This API is still under development and will evolve.

You’ll succeed if you do this.

Here’s some useful information.

Something may not happen if you try and do this.

Something bad will happen if you do this.

Authentication Edit

You need to be authenticated for all API requests. You can request an API key and password by contacting us here.

Authenticate using the API key and password to access all requests

Nothing will work unless you are authenticated

Errors Edit

Code Name Description
200 OK Success
201 Created Creation Successful
400 Bad Request We could not process that action
403 Forbidden We couldn’t authenticate you

All errors will return JSON in the following format:

{
  "error": true,
  "message": "error message here"
}

/events Edit

Get all the events

Parameters
offset
Offset the results by this amount
limit
Limit the number of users and events returned

This call will return a maximum of 100 records

Lists all the events in the system. You can paginate by using the parameters listed above.

var request = require("request");
request("http://3.89.81.232:1341/events", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
[
  {
    "id": 1,
    "name": "Lost Job",
    "description": "account gets credited by 1000 dollars",
    "eventCategory": {
      "name": "personal"
    }
  },
  {
    "id": 2,
    "name": "Closed Mortgage",
    "description": "account debited by 10000 dollars",
    "eventCategory": {
      "name": "financial"
    }
  }
]
{
  "error": true,
  "message": "Event does not exist"
}

/events/:id Edit

Get a specific event

var request = require("request");
request("http://3.89.81.232:1341/events/2", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
{
  {
    "id": 2,
    "name": "Closed Mortgage",
    "description": "account debited by 10000 dollars",
    "eventCategory": {
      "name": "financial"
    }
  }
}
{
  "error": true,
  "message": "Event does not exist"
}

/events/users/ Edit

Get all the users of all the events

Parameters
offset
Offset the results by this amount
limit
Limit the number of users and events returned

This call will return a maximum of 100 records

Lists all the users for all the events in the system. You can paginate by using the parameters listed above.

var request = require("request");
request("http://3.89.81.232:1341/events/users", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
[ 
  {
    "id": 1,
    "user": {
      "id": 1,
      "firstName": "tony",
      "lastName": "stark",
      "age": 50,
      "address1": "home",
      "city": "nyc",
      "country": "nyc",
      "zip": "10001"
    },
    "event": {
      "id": 1,
      "name": "Lost Job",
      "description": "account gets credited by 1000 dollars"
    },
    "asOfDate": "2019-06-11T18:30:00.000Z",
    "cluster": 1,
    "confidence": 0.32
  },
  {
    "id": 2,
    "user": {
      "id": 2,
      "firstName": "steve",
      "lastName": "rogers",
      "age": 50,
      "address1": "home",
      "city": "nyc",
      "country": "nyc",
      "zip": "10002"
    },
    "event": {
      "id": 2,
      "name": "Closed Mortgage",
      "description": "account debited by 10000 dollars"
    },
    "asOfDate": "2019-06-11T18:30:00.000Z",
    "cluster": 1,
    "confidence": 0.54
  }
]
{
  "error": true,
  "message": "User does not exist"
}

/events/:id/users/ Edit

Get all the users of a specific event

Parameters
offset
Offset the results by this amount
limit
Limit the number of users and events returned

This call will return a maximum of 100 records

Lists all the users for a specific event in the system. You can paginate by using the parameters listed above.

var request = require("request");
request("http://3.89.81.232:1341/events/2/users", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
[
  {
    "id": 2,
    "user": {
      "id": 2,
      "firstName": "steve",
      "lastName": "rogers",
      "age": 50,
      "address1": "home",
      "city": "nyc",
      "country": "nyc",
      "zip": "10002"
    },
    "event": {
      "id": 2,
      "name": "Closed Mortgage",
      "description": "account debited by 10000 dollars"
    },
    "asOfDate": "2019-06-11T18:30:00.000Z",
    "cluster": 1,
    "confidence": 0.54
  },
  {
    "id": 3,
    "user": {
      "id": 1,
      "firstName": "tony",
      "lastName": "stark",
      "age": 50,
      "address1": "home",
      "city": "nyc",
      "country": "nyc",
      "zip": "10001"
    },
    "event": {
      "id": 2,
      "name": "Closed Mortgage",
      "description": "account debited by 10000 dollars"
    },
    "asOfDate": "2019-06-11T18:30:00.000Z",
    "cluster": 1,
    "confidence": 0.12
  }
]
{
  "error": true,
  "message": "User does not exist"
}

/clusters/:id/transactions Edit

This API will be used when a user clicks on Details in Events section on portal.The response of this API will give all the transactions of a particular cluster

var request = require("request");
request("http://3.89.81.232:1341/clusters/1/transactions", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
{
  "cluster": {
    "id": 1,
    "recurringTransactionType": 1,
    "recurringType": "monthly",
    "category": "income",
    "meanAmount": 100,
    "meanDate": null,
    "varianceAmount": 10,
    "varianceDate": 11,
    "generalDescription": "Kapitalwise salary credit",
    "asOfDate": "2019-06-17T00:00:00.000Z"
  },
  "transactions": [
    {
      "id": 1,
      "actualFeatures": {
        "id": 2,
        "date": "2019-01-02T00:00:00.000Z",
        "amount": 2,
        "holdingDescription": null
      },
      "derivedFeatures": {
        "overallConfidence": 67,
        "categoryBasedAnomaly": 12,
        "dateBasedAnomaly": 11,
        "amountBasedAnomaly": 4,
        "descriptionBasedAnomaly": 4,
        "asOfDate": "2019-06-17T00:00:00.000Z"
      }
    },
    {
      "id": 2,
      "actualFeatures": {
        "id": 1,
        "date": "2018-12-01T00:00:00.000Z",
        "amount": 1,
        "holdingDescription": null
      },
      "derivedFeatures": {
        "overallConfidence": 87,
        "categoryBasedAnomaly": 3,
        "dateBasedAnomaly": 4,
        "amountBasedAnomaly": 1,
        "descriptionBasedAnomaly": 5,
        "asOfDate": "2019-06-17T00:00:00.000Z"
      }
    },
    {
      "id": 3,
      "actualFeatures": {
        "id": 5,
        "date": "2019-03-02T00:00:00.000Z",
        "amount": 4,
        "holdingDescription": null
      },
      "derivedFeatures": {
        "overallConfidence": 76,
        "categoryBasedAnomaly": 4,
        "dateBasedAnomaly": 6,
        "amountBasedAnomaly": 8,
        "descriptionBasedAnomaly": 9,
        "asOfDate": "2019-06-17T00:00:00.000Z"
      }
    },
    {
      "id": 4,
      "actualFeatures": {
        "id": 3,
        "date": "2019-02-01T00:00:00.000Z",
        "amount": 3,
        "holdingDescription": null
      },
      "derivedFeatures": {
        "overallConfidence": 76,
        "categoryBasedAnomaly": 16,
        "dateBasedAnomaly": 5,
        "amountBasedAnomaly": 6,
        "descriptionBasedAnomaly": 5,
        "asOfDate": "2019-06-17T00:00:00.000Z"
      }
    },
    {
      "id": 5,
      "actualFeatures": {
        "id": 4,
        "date": "2019-03-02T00:00:00.000Z",
        "amount": 4,
        "holdingDescription": null
      },
      "derivedFeatures": {
        "overallConfidence": 78,
        "categoryBasedAnomaly": 4,
        "dateBasedAnomaly": 7,
        "amountBasedAnomaly": 12,
        "descriptionBasedAnomaly": 3,
        "asOfDate": "2019-06-17T00:00:00.000Z"
      }
    }
  ]
}
{
  "error": true,
  "message": "transaction does not exist"
}

/users Edit

List all users

Parameters
offset
Offset the results by this amount
limit
Limit the number of users returned

This call will return a maximum of 100 users

Lists all the users in the system. You can paginate by using the parameters listed above.

var request = require("request");
request("http://3.89.81.232:1341/users", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
[
  {
    "id": 1,
    "firstName": "tony",
    "lastName": "stark",
    "age": 50,
    "address1": "home",
    "city": "nyc",
    "country": "nyc",
    "zip": "10001",
    "accounts": [
      1,
      2,
      3
    ],
  },
  {
    "id": 2,
    "firstName": "steve",
    "lastName": "rogers",
    "age": 50,
    "address1": "home",
    "city": "nyc",
    "country": "nyc",
    "zip": "10002",
    "accounts": [
      4
    ],
  },
]
{
  "error": true,
  "message": "User does not exist"
}

/users/:id Edit

Get User

Returns a specific user from the system

var request = require("request");
request("http://3.89.81.232:1341/users/1", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
{
  "id": 1,
  "firstName": "tony",
  "lastName": "stark",
  "age": 50,
  "address1": "home",
  "city": "nyc",
  "country": "nyc",
  "zip": "10001",
  "accounts": [
    1,
    2,
    3
  ]
}
{
  "error": true,
  "message": "User does not exist"
}

/users/:id/accounts Edit

Get all accounts of a specific User

Parameters
offset
Offset the results by this amount
limit
Limit the number of accounts returned

Returns all the accounts of a specific user from the system

var request = require("request");
request("http://3.89.81.232:1341/users/1/accounts", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
{
  "id": 1,
  "accounts": [
    {
      "id": 1,
      "externalId": "vzeNDwK7KQIm4yEog683uElbp9GRLEFXGK98D",
      "accountName": "Chase Saving",
      "accountNumber": "XXXX4230",
      "availableBalance": 1000,
      "userId": 1,
      "nickname": "My Chase Saving",
      "accountType": "Saving",
      "accountSubType": "FUNDING",
      "providerType": "kw",
      "loginName": "ydltestlogin",
      "password": "ydltestpassword",
      "memo": "Test memo",
      "status": "ACTIVE"
    },
    {
      "id": 2,
      "externalId": "vzeNDwK7KQIm4yEog683uElbp9GRLEFXGK98D",
      "accountName": "Chase Credit",
      "accountNumber": "XXXX4230",
      "availableBalance": 1000,
      "userId": 1,
      "nickname": "My Chase Credit",
      "accountType": "Credit",
      "accountSubType": "FUNDING",
      "providerType": "kw",
      "loginName": "ydltestlogin",
      "password": "ydltestpassword",
      "memo": "Test memo",
      "status": "ACTIVE"
    },
    {
      "id": 3,
      "externalId": "vzeNDwK7KQIm4yEog683uElbp9GRLEFXGK98D",
      "accountName": "Chase Checking",
      "accountNumber": "XXXX4230",
      "availableBalance": 1000,
      "userId": 1,
      "nickname": "My Chase Checking",
      "accountType": "Checking",
      "accountSubType": "FUNDING",
      "providerType": "kw",
      "loginName": "ydltestlogin",
      "password": "ydltestpassword",
      "memo": "Test memo",
      "status": "ACTIVE"
    }
  ]
}
{
  "error": true,
  "message": "Account does not exist"
}

/users/:id/events Edit

Get all events of a specific User

Parameters
offset
Offset the results by this amount
limit
Limit the number of events returned

Returns all the events of a specific user from the system

var request = require("request");
request("http://3.89.81.232:1341/users/1/events", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
[
  {
    "id": 1,
    "user": {
      "id": 1,
      "firstName": "tony",
      "lastName": "stark",
      "age": 50,
      "address1": "home",
      "city": "nyc",
      "country": "nyc",
      "zip": "10001"
    },
    "event": {
      "id": 1,
      "name": "Lost Job",
      "description": "account gets credited by 1000 dollars"
    },
    "asOfDate": "2019-06-12T00:00:00.000Z"
  },
  {
    "id": 3,
    "user": {
      "id": 1,
      "firstName": "tony",
      "lastName": "stark",
      "age": 50,
      "address1": "home",
      "city": "nyc",
      "country": "nyc",
      "zip": "10001"
    },
    "event": {
      "id": 2,
      "name": "Closed Mortgage",
      "description": "account debited by 10000 dollars"
    },
    "asOfDate": "2019-06-12T00:00:00.000Z"
  }
]
{
  "error": true,
  "message": "Event does not exist"
}

/users/:id/cashflow Edit

Get all cashflow of a specific User

Parameters
offset
Offset the results by this amount
limit
Limit the number of records returned

Returns all the cashflow of a specific user from the system

var request = require("request");
request("http://3.89.81.232:1341/users/1/cashflow", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
[
  {
    "id": 1,
    "user": 1,
    "account": {
      "id": 1,
      "accountNumber": "XXXX4230",
      "accountType": "Saving"
    },
    "accountBalance": 1000,
    "recurringExpense": 1000,
    "income": 10000,
    "miscellaneousExpense": 100,
    "miscellaneousIncome": 100,
    "predictedAccountBalance": 10000,
    "predictedFunding": 10000,
    "asOfDate": "2020-02-02T00:00:00.000Z"
  },
  {
    "id": 2,
    "user": 1,
    "account": {
      "id": 2,
      "accountNumber": "XXXX4230",
      "accountType": "Credit"
    },
    "accountBalance": 1000,
    "recurringExpense": 1000,
    "income": 10000,
    "miscellaneousExpense": 100,
    "miscellaneousIncome": 100,
    "predictedAccountBalance": 10000,
    "predictedFunding": 10000,
    "asOfDate": "2020-02-02T00:00:00.000Z"
  },
  {
    "id": 3,
    "user": 1,
    "account": {
      "id": 3,
      "accountNumber": "XXXX4230",
      "accountType": "Checking"
    },
    "accountBalance": 1000,
    "recurringExpense": 1000,
    "income": 10000,
    "miscellaneousExpense": 100,
    "miscellaneousIncome": 100,
    "predictedAccountBalance": 10000,
    "predictedFunding": 10000,
    "asOfDate": "2020-02-02T00:00:00.000Z"
  }
]
{
  "error": true,
  "message": "No cashflow predictions found"
}

/users/:id/product-recommendations Edit

Get all product recommendations of a specific User

Parameters
offset
Offset the results by this amount
limit
Limit the number of records returned

Returns all the product recommendations of a specific user from the system

var request = require("request");
request("http://3.89.81.232:1341/users/1/productrecommendations", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
[
  {
    "id": 1,
    "user": 1,
    "product": {
      "id": 1,
      "name": "deposit account",
      "description": "deposit",
      "iconUrl": "deposit"
    },
    "rank": 1
  },
  {
    "id": 3,
    "user": 1,
    "product": {
      "id": 2,
      "name": "Bank of America Mortgage",
      "description": "mortgage",
      "iconUrl": "mortgage"
    },
    "rank": 1
  }
]
{
  "error": true,
  "message": "No product recommendations found"
}

/users/:id/products Edit

Get all products of a specific User

Parameters
offset
Offset the results by this amount
limit
Limit the number of records returned

Returns all the products of a specific user from the system

var request = require("request");
request("http://3.89.81.232:1341/users/1/products", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
[
  {
    "id": 1,
    "user": 1,
    "product": {
      "id": 2,
      "name": "Bank of America Mortgage",
      "description": "mortgage",
      "iconUrl": "mortgage"
    }
  },
  {
    "id": 2,
    "user": 1,
    "product": {
      "id": 3,
      "name": "Credit Card",
      "description": "Chase Slate Credit Card",
      "iconUrl": "credit"
    }
  }
]
{
  "error": true,
  "message": "No product found"
}

/users/:id/transactioncounts Edit

Get all monthly transaction counts of a specific User

Parameters
offset
Offset the results by this amount
limit
Limit the number of records returned
months
Get transaction counts from last 'x' months, default is 12 months

Returns all the monthly transaction counts of a specific user from the system

var request = require("request");
request("http://3.89.81.232:1341/users/1/transactioncounts", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
[
  {
    "userId": 1,
    "month": "2018-08-01T00:00:00+05:30",
    "transactions": 0
  },
  {
    "userId": 1,
    "month": "2018-09-01T00:00:00+05:30",
    "transactions": 0
  },
  {
    "userId": 1,
    "month": "2018-10-01T00:00:00+05:30",
    "transactions": 0
  },
  {
    "userId": 1,
    "month": "2018-11-01T00:00:00+05:30",
    "transactions": 0
  },
  {
    "userId": 1,
    "month": "2018-12-01T00:00:00+05:30",
    "transactions": 1
  },
  {
    "userId": 1,
    "month": "2019-01-01T00:00:00+05:30",
    "transactions": 1
  },
  {
    "userId": 1,
    "month": "2019-02-01T00:00:00+05:30",
    "transactions": 1
  },
  {
    "userId": 1,
    "month": "2019-03-01T00:00:00+05:30",
    "transactions": 1
  },
  {
    "userId": 1,
    "month": "2019-04-01T00:00:00+05:30",
    "transactions": 0
  },
  {
    "userId": 1,
    "month": "2019-05-01T00:00:00+05:30",
    "transactions": 0
  },
  {
    "userId": 1,
    "month": "2019-06-01T00:00:00+05:30",
    "transactions": 0
  },
  {
    "userId": 1,
    "month": "2019-07-01T00:00:00+05:30",
    "transactions": 0
  }
]
{
  "error": true,
  "message": "necessary parameter(s) are missing"
}

/accounts Edit

List all active accounts

Parameters
offset
Offset the results by this amount
limit
Limit the number of accounts returned

This call will return a maximum of 100 accounts

Lists all the active accounts in the system. You can paginate by using the parameters listed above.

var request = require("request");
request("http://3.89.81.232:1341/accounts", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
[
  {
    "id": 1,
    "externalId": "vzeNDwK7KQIm4yEog683uElbp9GRLEFXGK98D",
    "accountName": "Chase Saving",
    "accountNumber": "XXXX4230",
    "availableBalance": 1000,
    "userId": 1,
    "nickname": "My Chase Saving",
    "accountType": "Saving",
    "accountSubType": "FUNDING",
    "providerType": "kw",
    "loginName": "ydltestlogin",
    "password": "ydltestpassword",
    "memo": "Test memo",
    "status": "ACTIVE"
  },
  {
    "id": 2,
    "externalId": "vzeNDwK7KQIm4yEog683uElbp9GRLEFXGK98D",
    "accountName": "Chase Credit",
    "accountNumber": "XXXX4230",
    "availableBalance": 1000,
    "userId": 1,
    "nickname": "My Chase Credit",
    "accountType": "Credit",
    "accountSubType": "FUNDING",
    "providerType": "kw",
    "loginName": "ydltestlogin",
    "password": "ydltestpassword",
    "memo": "Test memo",
    "status": "ACTIVE"
  },
  {
    "id": 3,
    "externalId": "vzeNDwK7KQIm4yEog683uElbp9GRLEFXGK98D",
    "accountName": "Chase Checking",
    "accountNumber": "XXXX4230",
    "availableBalance": 1000,
    "userId": 1,
    "nickname": "My Chase Checking",
    "accountType": "Checking",
    "accountSubType": "FUNDING",
    "providerType": "kw",
    "loginName": "ydltestlogin",
    "password": "ydltestpassword",
    "memo": "Test memo",
    "status": "ACTIVE"
  }  
]
{
  "error": true,
  "message": "account does not exist"
}

/accounts/:id Edit

Get a specific Account

var request = require("request");
request("http://3.89.81.232:1341/accounts/1", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
{
  "id": 1,
  "externalId": "vzeNDwK7KQIm4yEog683uElbp9GRLEFXGK98D",
  "accountName": "Chase Saving",
  "accountNumber": "XXXX4230",
  "availableBalance": 1000,
  "userId": 1,
  "nickname": "My Chase Saving",
  "accountType": "Saving",
  "accountSubType": "FUNDING",
  "providerType": "kw",
  "loginName": "ydltestlogin",
  "password": "ydltestpassword",
  "memo": "Test memo",
  "status": "ACTIVE"
}
{
  "error": true,
  "message": "account does not exist"
}

/accounts/:id/transactions Edit

Get Transactions of an account

Parameters
offset
Offset the results by this amount
limit
Limit the number of accounts returned

Returns all transactions of a specific account

var request = require("request");
request("http://3.89.81.232:1341/accounts/1/transactions", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
{
  "id": 1,
  "accountName": "Chase Saving",
  "transactions": [
    {
      "id": 1,
      "date": "2018-12-01T00:00:00.000Z",
      "amount": 1000
    },
    {
      "id": 2,
      "date": "2019-01-02T00:00:00.000Z",
      "amount": 2000
    },
    {
      "id": 3,
      "date": "2019-02-01T00:00:00.000Z",
      "amount": 3000
    },
    {
      "id": 4,
      "date": "2019-03-02T00:00:00.000Z",
      "amount": 4000
    }
  ]
}
{
  "error": true,
  "message": "Transaction does not exist"
}

/products Edit

List all products

Parameters
offset
Offset the results by this amount
limit
Limit the number of products returned

This call will return a maximum of 100 products

Lists all the products in the system. You can paginate by using the parameters listed above.

var request = require("request");
request("http://3.89.81.232:1341/products", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
[
  {
    "id": 1,
    "name": "deposit account",
    "description": "deposit",
    "iconUrl": "deposit"
  },
  {
    "id": 2,
    "name": "Bank of America Mortgage",
    "description": "mortgage",
    "iconUrl": "mortgage"
  },
  {
    "id": 3,
    "name": "Credit Card",
    "description": "Chase Slate Credit Card",
    "iconUrl": "credit"
  }
]
{
  "error": true,
  "message": "Product does not exist"
}

/products/:id Edit

Get all insights count of a specific product

var request = require("request");
request("http://3.89.81.232:1341/products/1", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
{
  "product": {
    "id": 1,
    "name": "deposit account",
    "description": "deposit",
    "iconUrl": "deposit"
  },
  "count": {
    "customerChurnCount": 0,
    "opportunity": 1,
    "prediction": 2,
    "largedeposit": 0
  }
}
{
  "error": true,
  "message": "product does not exist"
}
{
  "error": true,
  "message": "Insight does not exist"
}

/products/:id/users Edit

Get all users of a specific insight for a specific product

Parameters
insight
id of insight
var request = require("request");
request("http://3.89.81.232:1341/products/1/users?insight=3", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
{
  "product": {
    "id": 1,
    "name": "deposit account",
    "description": "deposit",
    "iconUrl": "deposit"
  },
  "users": [
    {
      "id": 1,
      "user": {
        "id": 1,
        "firstName": "tony",
        "lastName": "stark",
        "age": 50,
        "address1": "home",
        "city": "nyc",
        "country": "nyc",
        "zip": "10001"
      }
    },
    {
      "id": 2,
      "user": {
        "id": 2,
        "firstName": "steve",
        "lastName": "rogers",
        "age": 50,
        "address1": "home",
        "city": "nyc",
        "country": "nyc",
        "zip": "10002"
      }
    }
  ]
}
{
  "error": true,
  "message": "necessary parameter(s) are missing"
}
{
  "error": true,
  "message": "product does not exist"
}
{
  "error": true,
  "message": "Insight does not exist"
}
{
  "error": true,
  "message": "User does not exist"
}

/uploadfilelogs Edit

List logs of upload files

Parameters
offset
Offset the results by this amount
limit
Limit the number of records returned

This call will return a maximum of 100 records

Lists all the upload file logs in the system. You can paginate by using the parameters listed above.

var request = require("request");
request("http://3.89.81.232:1341/uploadfilelogs", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
[
  {
    "id": 42,
    "date": "2019-07-09T18:30:00.000Z",
    "uploadType": "account",
    "recordCount": 7,
    "fileName": "SampleAccounts.csv-HYC1Q46GeLutAkisIwNjTdwKqv758GFy",
    "status": "Success",
    "keyName": "1234_SampleAccounts.csv",
    "bucket": "kw-sc",
    "version": "HYC1Q46GeLutAkisIwNjTdwKqv758GFy"
  },
  {
    "id": 43,
    "date": "2019-07-09T18:30:00.000Z",
    "uploadType": "account",
    "recordCount": 7,
    "fileName": "SampleAccounts.csv",
    "status": "Failed",
    "keyName": "1256_SampleAccounts.csv",
    "bucket": "kw-sc",
    "version": "none"
  },
  {
    "id": 44,
    "date": "2019-07-09T18:30:00.000Z",
    "uploadType": "account",
    "recordCount": 7,
    "fileName": "SampleAccounts.csv-lDeIDllM0Nl4xhW5A4PSzjKpuiSbPWgA",
    "status": "Success",
    "keyName": "1278_SampleAccounts.csv",
    "bucket": "kw-sc",
    "version": "lDeIDllM0Nl4xhW5A4PSzjKpuiSbPWgA"
  }
]
{
  "error": true,
  "message": "Data does not exist"
}

/uploadfile Edit

post api for uploading files and saving data in database

Parameters
file
file to be uploaded
type
type of file {account, transaction}
id
id of currently logged in user
var request = require("request");
let options = {
           method: 'POST',
           uri: 'http://3.89.81.232:1341/uploadfile',
           formData: formData
          };
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
{ 
  "message": "file saved successfully!" 
}

/downloadfile Edit

downloads the file in the specified path

Parameters
key
key of file to be downloaded
bucket
bucket from where file to be downloaded
var request = require("request");
request("http://3.89.81.232:1341/downloadfile?key=SampleAccounts.csv&&bucket=kw-sc", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}

/analyst/events Edit

Get all the details of the events predicted

Parameters
offset
Offset the results by this amount
limit
Limit the number of events returned

This call will return a maximum of 100 records

Lists all the events in the system. You can paginate by using the parameters listed above.

var request = require("request");
request("http://3.89.81.232:1341/analyst/events", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
[
  {
    "id": 1,
    "event": {
      "id": 1,
      "name": "Lost Job",
      "description": "account gets credited by 1000 dollars"
    },
    "asOfDate": "2019-06-11T18:30:00.000Z",
    "eventSource": {
      "cluster": {
        "id": 1,
        "recurringTransactionType": 1,
        "recurringType": "monthly",
        "category": "income",
        "meanAmount": 100,
        "meanDate": null,
        "varianceAmount": 10,
        "varianceDate": 11,
        "generalDescription": "Kapitalwise salary credit",
        "asOfDate": "2019-06-16T18:30:00.000Z"
      },
      "transactions": [
        {
          "id": 1,
          "actualFeatures": {
            "id": 2,
            "date": "2019-01-01T18:30:00.000Z",
            "amount": 2,
            "holdingDescription": null
          },
          "derivedFeatures": {
            "overallConfidence": 67,
            "categoryBasedAnomaly": 12,
            "dateBasedAnomaly": 11,
            "amountBasedAnomaly": 4,
            "descriptionBasedAnomaly": 4,
            "asOfDate": "2019-06-16T18:30:00.000Z"
          }
        },
        {
          "id": 2,
          "actualFeatures": {
            "id": 1,
            "date": "2018-11-30T18:30:00.000Z",
            "amount": 1,
            "holdingDescription": null
          },
          "derivedFeatures": {
            "overallConfidence": 87,
            "categoryBasedAnomaly": 3,
            "dateBasedAnomaly": 4,
            "amountBasedAnomaly": 1,
            "descriptionBasedAnomaly": 5,
            "asOfDate": "2019-06-16T18:30:00.000Z"
          }
        },
        {
          "id": 3,
          "actualFeatures": {
            "id": 5,
            "date": "2019-03-01T18:30:00.000Z",
            "amount": 4,
            "holdingDescription": null
          },
          "derivedFeatures": {
            "overallConfidence": 76,
            "categoryBasedAnomaly": 4,
            "dateBasedAnomaly": 6,
            "amountBasedAnomaly": 8,
            "descriptionBasedAnomaly": 9,
            "asOfDate": "2019-06-16T18:30:00.000Z"
          }
        },
        {
          "id": 4,
          "actualFeatures": {
            "id": 3,
            "date": "2019-01-31T18:30:00.000Z",
            "amount": 3,
            "holdingDescription": null
          },
          "derivedFeatures": {
            "overallConfidence": 76,
            "categoryBasedAnomaly": 16,
            "dateBasedAnomaly": 5,
            "amountBasedAnomaly": 6,
            "descriptionBasedAnomaly": 5,
            "asOfDate": "2019-06-16T18:30:00.000Z"
          }
        },
        {
          "id": 5,
          "actualFeatures": {
            "id": 4,
            "date": "2019-03-01T18:30:00.000Z",
            "amount": 4,
            "holdingDescription": null
          },
          "derivedFeatures": {
            "overallConfidence": 78,
            "categoryBasedAnomaly": 4,
            "dateBasedAnomaly": 7,
            "amountBasedAnomaly": 12,
            "descriptionBasedAnomaly": 3,
            "asOfDate": "2019-06-16T18:30:00.000Z"
          }
        }
      ]
    },
    "eventPredictionDetails": {
      "id": 1,
      "recurringTransactionType": 1,
      "transactionCount": 10,
      "amountAnomalyLastTransaction": 0.1,
      "dateAnomalyLastTransaction": 0.1,
      "descriptionAnomalyLastTransaction": 0.1,
      "categoryAnomalyLastTransaction": 0.1
    },
    "confidence": 0.32
  }
]
{
  "error": true,
  "message": "Event does not exist"
}

/analyst/events Edit

store the feedback of events predicted

Parameters
id
id of table eventPrediction
correctedEvent
id of the event entered by the analyst
confidence
scale based score given by analyst
feedbackUser
username of the feedback user
comment
comment given by analyst
var request = require("request");
let options = {
           method: 'POST',
           uri: 'http://3.89.81.232:1341/analyst/events',
           formData: formData
          };
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
{
  "message": "created event prediction feedback successfully" 
}

/analyst/clusters Edit

Get all the transactions of all the clusters

var request = require("request");
request("http://3.89.81.232:1341/analyst/clusters", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
[
  {
    "id": 1,
    "recurringTransactionType": 1,
    "recurringType": "monthly",
    "category": "income",
    "meanAmount": 100,
    "meanDate": 12,
    "varianceAmount": 10,
    "varianceDate": null,
    "generalDescription": 0,
    "asOfDate": 2019,
    "transactions": [
      {
        "id": 1,
        "actualFeatures": {
          "id": 2,
          "date": "2019-01-02T00:00:00.000Z",
          "amount": 2,
          "holdingDescription": null
        },
        "derivedFeatures": {
          "overallConfidence": 0.67,
          "categoryBasedAnomaly": 0.34,
          "dateBasedAnomaly": 0.14,
          "amountBasedAnomaly": 0.67,
          "descriptionBasedAnomaly": 0.32,
          "asOfDate": null
        }
      },
      {
        "id": 2,
        "actualFeatures": {
          "id": 1,
          "date": "2018-12-01T00:00:00.000Z",
          "amount": 1,
          "holdingDescription": null
        },
        "derivedFeatures": {
          "overallConfidence": 0.87,
          "categoryBasedAnomaly": 0.03,
          "dateBasedAnomaly": 0.04,
          "amountBasedAnomaly": 0.01,
          "descriptionBasedAnomaly": 0.05,
          "asOfDate": null
        }
      }
    ]
  },
  {
    "id": 2,
    "recurringTransactionType": 2,
    "recurringType": "monthly",
    "category": "mortage",
    "meanAmount": 100,
    "meanDate": null,
    "varianceAmount": 12,
    "varianceDate": 12,
    "generalDescription": 0,
    "asOfDate": 2019,
    "transactions": [
      {
        "id": 3,
        "actualFeatures": {
          "id": 3,
          "date": "2019-02-01T00:00:00.000Z",
          "amount": 3,
          "holdingDescription": null
        },
        "derivedFeatures": {
          "overallConfidence": 0.45,
          "categoryBasedAnomaly": 0.12,
          "dateBasedAnomaly": 0.03,
          "amountBasedAnomaly": 0.04,
          "descriptionBasedAnomaly": 0.78,
          "asOfDate": null
        }
      }
    ]
  }
]
{
  "error": true,
  "message": "transactions not found"
}

/analyst/clusters Edit

update the fields entered by the analyst

Parameters
id
id of table eventPrediction
analystConfidenceTransToCluster
................. score given by Analyst
universalReccurTransConfidence
................ score given by analyst
feedbackUser
username of the feedback user
clusterComment
comment given by analyst
universalComment
comment given by analyst
correctedCluster
id of cluster entered by analyst
var request = require("request");
let options = {
           method: 'PUT',
           uri: 'http://3.89.81.232:1341/analyst/cluster',
           formData: formData
          };
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
{
  "message": "Updated ClusterTransactionMapFeedback Successfully" 
}

/transactions/:id/clusters Edit

This API will give analyst all the available clusters related to a transaction to select the most appropriate one for that particular transaction

var request = require("request");
request("http://3.89.81.232:1341/transactions/1/clusters", function (error, response, body) {
if (!error && response.statusCode == 200) {
  console.log(body);
}
{
  "id": "1",
  "clusters": [
    {
      "id": 1,
      "recurringTransactionType": 1,
      "recurringType": "monthly",
      "category": "income",
      "meanAmount": 100,
      "meanDate": null,
      "varianceAmount": 10,
      "varianceDate": 11,
      "generalDescription": "Kapitalwise salary credit",
      "asOfDate": "2019-06-17T00:00:00.000Z"
    },
    {
      "id": 2,
      "recurringTransactionType": 2,
      "recurringType": "monthly",
      "category": "mortgage",
      "meanAmount": 100,
      "meanDate": null,
      "varianceAmount": 12,
      "varianceDate": 12,
      "generalDescription": "debit for mortgage",
      "asOfDate": "2019-06-17T00:00:00.000Z"
    }
  ]
}
{
  "error": true,
  "message": "cluster does not exist"
}