This SDK was generated using Swagger Code Generator. The SDK can be used as a module in your code and the examples demonstrate how to connect to financial institutions integrated with Yapily.
To connect to the Yapily API, you will need to register your application at https://dashboard.yapily.com.
These application credentials will be used to authorise all your API requests.
The SDK can be installed from npm and can be included in your project by adding it to your dependencies
npm install @yapily/yapily-api
Sample usage of the SDK can be seen in the examples
folder.
- Configure the application credentials
var defaultClient = YapilyApi.ApiClient.instance;
var basicAuth = defaultClient.authentications['basicAuth']
basicAuth.username = constants.APPLICATION_ID
basicAuth.password = constants.APPLICATION_SECRET
- Retrieve a list of available financial institutions to connect to
var institutionsApi = new YapilyApi.InstitutionsApi()
institutionsApi.getInstitutionsUsingGET(function(error,institutions) {})
- Creating users and retrieving users for your application registered in the Yapily Dashboard
var usersApi = new YapilyApi.ApplicationUsersApi()
var appUser = new YapilyApi.ApplicationUser()
appUser.appUserId = "Bojack"
usersApi.addUserUsingPOST(appUser,function(error,user) {})
usersApi.getUsersUsingGET(function(error,users) {})
- Receiving an authorisation URL your users to log into their institution
var institutionAuthorisationUrl = YapilyApi.Auth.authDirectUrl('application-id','user-uuid','institution-id','callback url',"account")
- Receiving consents issued by your user authorizing
var opts = {
"institutionId": institutionId
}
//...
consentsApi.getUserConsentsUsingGET(userUUID,opts,function(error,consents) {})
- Returning user account details
var opts = { consent : consentToken };
//...
var accountsApi = new YapilyApi.AccountsApi();
accountsApi.getAccountsUsingGET(opts, accountsCallback);
- Returning user identity details
var opts = { consent : consentToken };
//...
var identitiesApi = new YapilyApi.IdentityApi();
identitiesApi.identityUsingGET(opts, identityCallback);
For more information on how to get connected, visit the Yapily developer resources repo.