Linkless with polling

Integration Steps

1. Request a Link Token

Call the /link/token/create endpoint to generate a link token.

Response:
Link_token: Use this for subsequent API calls.


2. Initiate Connection

Call the /link/connect endpoint to initiate the connection. For the source_id you can use any id corresponding to the provider that you want to connect to. Those are the same ids available in the Link widget when searching for a provider.

Request Example:

{  
  "link_token": "<link_token>",
  "source_id": "",
  "username": "xyz",  
  "password": "12345"  
}

Response:
Public_token: Exchange this for the Access_token


3. Exchange Public Token for Access Token

After successfully calling /link/connect, exchange the Public_token for an Access_token by calling the /connection/public_token/exchange endpoint.

Request Example:

{  
  "public_token": "<public_token>"  
}

Response:
Access_token for accessing data once the connection is established


4. Poll for the connection status

Call the /link/connection/status endpoint at a 5 seconds interval until the Connected status is returned

Request Example:

{  
  "link_token": "<link_token>"
}

Response Example:

{  
  "status": "Connected" 
}

5. Fetch Sustainability Data

Once connected, you can start calling the Product endpoint and decide what to do based on the response received.

Here's an example with calling the /sustainability/get endpoint using the Access_token.

Example Request:

{  
  "access_token": "<access_token>"  
}

Example Response:

{
  "error_category": "CONNECTION_ERROR",
  "error_code": "PRODUCT_NOT_READY",
  "error_message": "This connection is still ongoing, try again later",
  "display_message": null
}

If you get an error response with the PRODUCT_NOT_READY error code, it means the connection is currently processing and data is not available yet. This is normal and you can try calling the Product endpoint later.

As soon as the data is obtained from the connection and ready to be presented, the response will change to a 200 OK and the sustainability data for the connected account will be returned.