This is a python example that demonstrates how to connect to Tink API to fetch users transaction data.
The application requires a Tink API developer account.
- Create your developer account at Tink Console
- Follow the getting started guide to retrieve your
client_id
andclient_secret
- Register the redirect URI for the example app (
http://localhost:3000/callback
) in the list of redirect URIs under your app's settings
Using a Test Provider se-test-bankid-successful
Replace <YOUR_CLIENT_ID> first and then run:
https://link.tink.com/1.0/authorize/credentials/se-test-bankid-successful?client_id=<YOUR_CLIENT_ID>&redirect_uri=http://localhost:3000/callback&scope=accounts:read,investments:read,transactions:read,user:read&market=SE&locale=en_US&test=true
Social Security Number: 180012121212
On a successful authentication, your browser should redirect you to the redirect_uri
you specified in your Tink Link URL. It should contain an authorization code
, and your browser URL window will contain a URL similar to: {redirect_uri}/?code={YOUR_USER_AUTHORIZATION_CODE}
Prerequisites:
- Docker & docker-compose installed
- Run it:
$ CLIENT_ID=<YOUR_CLIENT_ID> CLIENT_SECRET=<YOUR_CLIENT_SECRET> CODE=<YOUR_USER_AUTHORIZATION_CODE> docker-compose up --build
Prerequisites:
- Python >= 3.7 installed
- pip installed
- Install the dependencies.
$ make init
- Set your client identifier, client secret and authorization code into the following environment variables
$ export CLIENT_ID="<YOUR_CLIENT_ID>"
$ export CLIENT_SECRET="<YOUR_CLIENT_SECRET>"
$ export CODE="<YOUR_AUTHORIZATION_CODE>
- Run the code:
$ make run
You will see two reports:
-
There's a BUG in https://docs.tink.com/api#search-query-transactions. The method should be
GET
rather thanPOST
. -
As discussed with the team, it's not yet possible to obtain the
USER_AUTHORIZATION_CODE
through the API for non Enterprise users so it would be great as a "next step" to automate it. Perhaps by just using a headless browser-based solution (e.g: Selenium, activesoup). -
As
USER_AUTHORIZATION_CODE
can't be automated yet, it has to be regenerated every time this solution is executed (see Prerequisites section)