⚡️ Quickstart: Retrieve test bank data
Learn how to connect with our Data API and retrieve bank data in a few quick steps.
In this guide, you'll connect with our Data API and retrieve test bank data. To do this, you will need to:
- Generate an authentication link. This link provides a simple user interface for your users to connect their bank accounts.
- Log in to our Mock Bank account and obtain an
access_token
. You'll use thisaccess_token
to get sample data including accounts, transactions and balances.
See it in action
Try our demo application Piggy Bank to see a working example of a TrueLayer integration.
Before you start
Sign up to Console and create an app. If this is your first time using Console, follow our Create a Console account quickstart guide to get up and running fast.
Configure Postman
First, download and configure the sandbox Data Postman collection.
This collection contains preconfigured requests to retrieve sample data and generate code snippets in various languages.
You can also download the live Postman collection and environment.
Authorise a test user
First, create an authentication link. This auth link provides an easy user interface to demo connecting to our Mock Bank. To do this:
- Go to Console > Data API > Auth Link Builder.
- In the Providers tab, select the Mock provider to test your integration with our Mock Bank.
- Switch to the Permissions tab to select the set of permissions that you want to include in the Authentication link. These permissions control which Data API endpoints your application can access.
- Switch to the Redirect URIs tab to choose a Redirect URI. This is where the user will be redirected after authentication.
- Click the Preview icon to open the test authentication link. Click Allow.
- Select Mock Bank and use a set of our Mock Bank credentials, for example john/doe, to get a
code
. - Store this code. You need it to get an access token.
Get an access token
To get a sandbox access token:
- In Postman, select the TrueLayer Data Products Sandbox environment.
- Add values to the following variables within the environment:
- client_id : Your sandbox
client_id
- client_secret : Your sandbox
client_secret
- redirect_uri : This variable already contains the default redirect URI from Console, but you can change it if you need to.
- client_id : Your sandbox
- Go to Exchange code for access token.
- In the Body tab, scroll down to the
code
parameter. Input the code you got from the test auth link. - Send the request. If successful, the response contains an
access_token
. This saves automatically.
A note on responses
If you have enabled the
offline_access
permission in Console, you will receive arefresh_token
as well as anaccess_token
in the response.
Access sample data
Now you have your access token, run any of the Data API requests to retrieve sample account numbers, transaction data or personal information.
For example: the List all accounts request within the Data > Accounts folder retrieves all account information for the given set of credentials.
Updated 6 months ago