Skip to content

Integration Example

These are the common steps most integrations with Flanks will have. Your particular use case can be a little different, but it's always a good idea to understand the general principles. Please contact us in case you have any doubts about the integration.

Prerequisites

This guide assumes that you will have some infrastructure on your end to:

  • Send links to final users.
  • Get the users back when they are redirected.
  • Do some sort of mapping between our credentials and your users in your database.
  • Call the Flanks APIs

However, initially you can do all these steps manually to get a grasp of how everything should work.

Configuration

  1. Make sure you can access the Flanks Platform.
  2. Create an Application to authenticate your API calls.
  3. Create a new Link to send to your users. Make your application the Redirect URI of the link.

Add New Credentials

The final user starts in your application. To add new credentials to the system, you need to:

  • Redirect the user to the link URL.
  • Once the user finishes the login process, they will get redirected to your Redirect URI with a link code.
  • Exchange the link code for the credentials token.
  • Store in your application the credentials token and assign it to the user.
  • Query the Credentials Status of the new credentials until they are not pending anymore (or the data you need is already in created).
  • Query the data you need using the Aggregation API.

The following diagram shows how these integration should look like:

sequenceDiagram
  Your Application->>Flanks Link: Redirect user
  Note right of Flanks Link: Do login
  Flanks Link->>Your Application: Redirect user (with link code)
  Your Application-->>Flanks API: Exchange link code
  Flanks API-->>Your Application: Return credentials token
  Note right of Your Application: Store credentials token
  loop Wait for data to be ready
      Your Application-->>Flanks API: Get credentials status
  end
  Your Application-->>Flanks API:Fetch data