@basiq/basiq-javascript-sdk
v1.0.3
Published
This SDK is here to accelerate your integration with the Basiq API. You can check out the full docs for this SDK at [GitHub](https://github.com/basiqio/basiq-javascript-sdk/), or head to [our website](https://basiq.io/) to learn more about Basiq.
Downloads
12
Keywords
Readme
Basiq Javascript SDK
This SDK is here to accelerate your integration with the Basiq API. You can check out the full docs for this SDK at GitHub, or head to our website to learn more about Basiq.
Installation
Install this package using npm
npm install @basiq/basiq-javascript-sdk
Usage
- Create an instance of the Basiq API object
var BasiqApi = require('@basiq/basiq-javascript-sdk');
var defaultClient = BasiqApi.ApiClient.instance;
- Authenticate by setting your access token (see postToken method)
var application = defaultClient.authentications['application'];
application.accessToken = "YOUR_ACCESS_TOKEN"
- Create an instance of the API object you need and call the relevant method.
Make sure to pass the relevant parameters and a callback to handle the response data.
See the full breakdown of requests and methods.
var accountsApi = new BasiqApi.AccountsApi()
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('Call made successfully! Basiq returned: ' + data);
}
};
api.getAccount(userId, accountId, callback);
Documentation for API Endpoints
All URIs are relative to https://au-api.basiq.io
Class | Method | HTTP request | Description ------------ | ---- | ------------- | ------------------------------- BasiqApi.AccountsApi | getAccount | GET /users/{userId}/accounts/{accountId} | Use this to retrieve the details of a specific account. This request will return back an account object with the latest data since the last refresh. If you require the latest account details you will need to call the connection refresh resource. BasiqApi.AccountsApi | getAccounts | GET /users/{userId}/accounts | Use this collection to retrieve a list of accounts. Each entry in the array is a separate account object. BasiqApi.AffordabilityApi | getAffordability | GET /users/{userId}/affordability/{snapshotId} | Retrieves the details of an affordability summary. You need only supply the unique affordability identifier. BasiqApi.AffordabilityApi | getAffordabilitySnapshotTransactions | GET /users/{userId}/affordability/{snapshotId}/transactions | Returns a paginated list with a data property that contains an array of transactions from the affordability snapshot. BasiqApi.AffordabilityApi | postAffordability | POST /users/{userId}/affordability | Use this to create a new affordability report. BasiqApi.AuthLinksApi | deleteAuthLink | DELETE /users/{userId}/auth_link | Permanently deletes an auth_link resource. Once deleted the URL associated with the deleted object will no longer be valid. BasiqApi.AuthLinksApi | getAuthLink | GET /users/{userId}/auth_link | Use this to retrieve the latest/last auth_link generated for the specified user.. BasiqApi.AuthLinksApi | postAuthLink | POST /users/{userId}/auth_link | An Auth Link object can be generated to securely capture data from a User. Using the URL allows data to be captured via the hosted Basiq Connect Consent workflow for a given User. BasiqApi.ConnectionsApi | deleteConnection | DELETE /users/{userId}/connections/{connectionId} | Permanently deletes a connection. BasiqApi.ConnectionsApi | getConnection | GET /users/{userId}/connections/{connectionId} | Use this to retrieve details of a specific connection. BasiqApi.ConnectionsApi | getConnections | GET /users/{userId}/connections | Use this to retrieve details of the connections. BasiqApi.ConnectionsApi | postConnection | POST /users/{userId}/connections | Use this to create a new connection. BasiqApi.ConnectionsApi | refreshConnection | POST /users/{userId}/connections/{connectionId}/refresh | Use this to retrieve the latest financial data. BasiqApi.ConnectionsApi | refreshConnections | POST /users/{userId}/connections/refresh | Use this to refresh of all connections. BasiqApi.ConnectionsApi | updateConnection | POST /users/{userId}/connections/{connectionId} | Use this to update the details of a specific connection. BasiqApi.EnrichApi | getEnrich | GET /enrich | The Enrich resource enables you to retrieve details by passing in a search query containing a bank transaction description. BasiqApi.ExpensesApi | getExpenses | GET /users/{userId}/expenses/{snapshotId} | Retrieves the details of an expenses summary. You need only supply the unique expenses identifier. BasiqApi.ExpensesApi | postExpenses | POST /users/{userId}/expenses | Use this to create a new expenses report. BasiqApi.IncomeApi | getIncome | GET /users/{userId}/income/{snapshotId} | Retrieves the details of an income summary. You need only supply the unique income identifier. BasiqApi.IncomeApi | postIncome | POST /users/{userId}/income | Use this to create a new income report. BasiqApi.InstitutionsApi | getInstitution | GET /institutions/{institutionID} | Retrieves data for single institution. BasiqApi.InstitutionsApi | getInstitutions | GET /institutions | Retrieves institutions list. BasiqApi.InstitutionsApi | getPublicInstitutions | GET /public/institutions | Retrieves publically availiable (no authentication required) institutions list. BasiqApi.JobsApi | getJobs | GET /jobs/{jobId} | Retrieves the details of an existing job. You need only supply the unique job identifier that was returned upon job creation. BasiqApi.JobsApi | getUserJobs | GET /users/{userId}/jobs | Retrieves the details of an existing jobs. You need only supply the unique user identifier. BasiqApi.StatementsApi | createStatement | POST /users/{userId}/statements | A user can choose to share their financial data by uploading official pdf bank statements instead of creating a bank connection. Once the statement object is successfully created you can use it to obtain the user's latest financial data extracted from the bank statement i.e. accounts and transactions. BasiqApi.TokenApi | postToken | POST /token | BasiqApi.TransactionsApi | getTransaction | GET /users/{userId}/transactions/{transactionId} | Retrieves the details of an existing transaction. BasiqApi.TransactionsApi | getTransactions | GET /users/{userId}/transactions | Use this collection to retrieve a paginated list of transactions. BasiqApi.UsersApi | createUser | POST /users | Use this to create a new user object. BasiqApi.UsersApi | deleteUser | DELETE /users/{userId} | Delete a user. BasiqApi.UsersApi | getUser | GET /users/{userId} | Retrieves the details of an existing user. You need only supply the unique user identifier that was returned upon user creation. BasiqApi.UsersApi | updateUser | POST /users/{userId} | Updates the specified user by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Documentation for Models
- BasiqApi.AccountClass
- BasiqApi.AccountHolder
- BasiqApi.AccountLinks
- BasiqApi.AccountResponseResource
- BasiqApi.AccountTransactionInterval
- BasiqApi.AccountsContainer
- BasiqApi.AccountsData
- BasiqApi.AccountsFeatures
- BasiqApi.AccountsResponseResource
- BasiqApi.AffordabilityAssetsData
- BasiqApi.AffordabilityPostRequest
- BasiqApi.AffordabilityRegularIncomeData
- BasiqApi.AffordabilityResponse
- BasiqApi.AffordabilitySummary
- BasiqApi.AffordabilityTransactionLinks
- BasiqApi.AffordabilityTransactionsGetLinks
- BasiqApi.AffordabilityTransactionsResponse
- BasiqApi.Anzsic
- BasiqApi.AssetsPrevious6MonthsData
- BasiqApi.AuthLinkLinks
- BasiqApi.AuthLinksPostResponseResource
- BasiqApi.AuthLinksResponseResource
- BasiqApi.AvgMonthlyData
- BasiqApi.BadRequestError
- BasiqApi.CategoryDataExpenses
- BasiqApi.ChangeHistoryAffordabilityData
- BasiqApi.ChangeHistoryExpensesClass
- BasiqApi.ChangeHistoryExternal
- BasiqApi.ChangeHistoryIncome
- BasiqApi.ClassDetails
- BasiqApi.ClassResourceExpenses
- BasiqApi.Colors
- BasiqApi.ConnectionAccountLinks
- BasiqApi.ConnectionGetResponseResource
- BasiqApi.ConnectionInstitution
- BasiqApi.ConnectionProfile
- BasiqApi.ConnectionResponseResource
- BasiqApi.ConnectionsData
- BasiqApi.ConnectionsGetResponseResource
- BasiqApi.ConnectionsRefreshResource
- BasiqApi.CreateUser
- BasiqApi.CreditLiabilities
- BasiqApi.CurrentIrregularSource
- BasiqApi.CurrentOtherCreditSource
- BasiqApi.CurrentRegularSource
- BasiqApi.DivisionDetails
- BasiqApi.EnrichCategory
- BasiqApi.EnrichData
- BasiqApi.EnrichGeometry
- BasiqApi.EnrichLocation
- BasiqApi.EnrichMerchant
- BasiqApi.EnrichPhoneNumber
- BasiqApi.ExpensesClass
- BasiqApi.ExpensesLinks
- BasiqApi.ExpensesPostRequest
- BasiqApi.ExpensesResponse
- BasiqApi.ExternalLiabilityData
- BasiqApi.ExternalPayment
- BasiqApi.FeatureCondition
- BasiqApi.Features
- BasiqApi.ForbiddenAccessError
- BasiqApi.Gap
- BasiqApi.GetAffordabilityLinks
- BasiqApi.GetConnectionLinks
- BasiqApi.GetConnectionsLinks
- BasiqApi.GetEnrichResponse
- BasiqApi.GetUserAccount
- BasiqApi.GetUserAccountData
- BasiqApi.GetUserConnection
- BasiqApi.GetUserConnectionData
- BasiqApi.GetUserLinks
- BasiqApi.GoneError
- BasiqApi.GroupDetails
- BasiqApi.IncomeLinks
- BasiqApi.IncomePostRequest
- BasiqApi.IncomeResponse
- BasiqApi.IncomeSummary
- BasiqApi.Institution
- BasiqApi.InstitutionLogoResource
- BasiqApi.InstitutionModel
- BasiqApi.InstitutionPerformanceStats
- BasiqApi.InstitutionsList
- BasiqApi.InternalServerError
- BasiqApi.IrregularSource
- BasiqApi.IrregularityIncome
- BasiqApi.JobData
- BasiqApi.JobsData
- BasiqApi.JobsInstitution
- BasiqApi.JobsLinks
- BasiqApi.JobsResponseResource
- BasiqApi.JobsResult
- BasiqApi.JobsStep
- BasiqApi.LiabilitiesData
- BasiqApi.LoanLiabilities
- BasiqApi.LogoResourceLinks
- BasiqApi.Meta
- BasiqApi.NotFoundError
- BasiqApi.OtherCreditSource
- BasiqApi.PaymentsSummaryExpenses
- BasiqApi.PhysicalAddresses
- BasiqApi.Previous3MonthsIncome
- BasiqApi.Previous6MonthsCreditLiabilities
- BasiqApi.Previous6MonthsLoan
- BasiqApi.PreviousMonthDataLiabilities
- BasiqApi.PreviousMonthDataLoanLiabilities
- BasiqApi.ProfileFeatures
- BasiqApi.RegularSource
- BasiqApi.ResourceLink
- BasiqApi.ResourceLinks
- BasiqApi.ResponseFormat
- BasiqApi.Source
- BasiqApi.SourceName
- BasiqApi.StatementUploadResource
- BasiqApi.StatusServiceUnavailableError
- BasiqApi.SubCategoryExpenses
- BasiqApi.SubClass
- BasiqApi.SubdivisionDetails
- BasiqApi.TokenPostResponse
- BasiqApi.TransactionData
- BasiqApi.TransactionDataAffordability
- BasiqApi.TransactionLinks
- BasiqApi.TransactionsAnzsic
- BasiqApi.TransactionsCategory
- BasiqApi.TransactionsClass
- BasiqApi.TransactionsDivision
- BasiqApi.TransactionsEnrich
- BasiqApi.TransactionsFeatures
- BasiqApi.TransactionsGeometry
- BasiqApi.TransactionsGetLinks
- BasiqApi.TransactionsGetResource
- BasiqApi.TransactionsGroup
- BasiqApi.TransactionsLocation
- BasiqApi.TransactionsMerchant
- BasiqApi.TransactionsPhoneNumber
- BasiqApi.TransactionsSubdivision
- BasiqApi.UnauthorizedError
- BasiqApi.UnsupportedMediaTypeError
- BasiqApi.UpdateUser
- BasiqApi.UserConnectionPostData
- BasiqApi.UserConnectionsPostData
- BasiqApi.UserGetResponse
- BasiqApi.UserPostResponse
Documentation for Authorization
api_key
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
application
- Type: OAuth
- Flow: application
- Authorization URL:
- Scopes:
- SERVER_ACCESS: Must only be used when making server side calls. This will provide you an all access token so should be handled securely on the server side.
- CLIENT_ACCESS: This token has restricted access and only allows the creation or update of a connection. If an attacker intercepts a request and steals your CLIENT_ACCESS token, the risk is mitigated as they will not be able to get your users' data.