Link Connect

Overview

For the Sandbox environment only, you can make a call from your backend to our link/connect endpoint to get the entity_uuid for our 2 fake entities in the Lean Mockbank. We've made this so that you can start building faster but remember that as soon as you want to work with live data, you'll need to use the Link SDK to get the entity_uuid.

Request

POST https://link.leantech.me/link/v1/sandbox-connect

Headers

HeaderDescription
lean-app-tokenHow Lean identifies your application. The App Token on your View Application page

Body

FieldDescription
bank_idThe bank in which your user’s account is held. For the sandbox, this is always 1, refering to the Lean Mockbank
app_user_idHow your application refers to the user internally in your databases
usernameThe user’s username for the bank (You can choose between mockbank_user_1 and mockbank_user_2)
passwordThe user’s password for the bank (This will be same as the username in the sandbox)
permissionsThe list of permissions your user is willing to give you for this connection

Example

curl -X POST 'https://link.leantech.me/link/v1/connect' \
--header 'Content-Type: application/json' \
--header 'lean-app-token: 2c9a80897169b1dd01716a0339e30003' \
--data-raw '{
"bank_id": 1,
"app_user_id": "00001",
"username": "mockbank_user_1",
"password": "mockbank_user_1",
"permissions": [
"identity",
"accounts",
"balance",
"transactions"
]
}'

Response

Example

{
"status": {
"code": "200",
"message": "Success, here's everything you need to retrieve your user's information"
},
"data": {
"entity": {
"entity_uuid": "f08fb010-878f-407a-9ac2-a7840fb56185",
"app_user_id": "00001",
"permissions": ["transactions", "balance", "identity", "accounts"],
"bank_details": {
"name": "Lean Mockbank 1",
"bank_identifier": "LEANMB1",
"logo_url": "https://www.leantech.me/mb1logo.png",
"primary_color": "#183F3F"
}
}
}
}

Body

status - Information about the status of your request

FieldDescription
codeWhat is the status code of the authorization, 200 is a success and 401 is a fail.
messageDescription of the status, this is more useful when there is a failure where it's used to give you more detail.

data/entity - Information about the entity created

FieldDescription
entity_uuidIf successful, the identifier you will use with data calls to refer to your user’s bank account.
app_user_idFor your convenience, we’ll also pass the id your application uses to reference the user
permissionsThe permissions your user granted to you

data/bank_details - Information about the bank in which your user's entity exists.

FieldDescription
nameThe name of the bank where your user's entity and accounts exist.
bank_identifierHow Lean internally refers to the bank. Can be used with the upcoming /bank endpoint
logo_urlA URL pointing to an image of the bank's logo.
primary_colorThe HEX value of the primary color the bank uses. For display purposes.

Note
You’ll notice this is the same as the body for the Callback URL in the next section.
This is only for the Sandbox environment and mock data to make it easier for you to start using Lean. To receive real data, you will not receive data syncronously and will instead receieve it through the Callback URL you provided.

Last updated on