https://api.usecobalt.com/link/token/create
to create a link_token
and pass it to your app’s client.link_token
to open Link for your user. In the onSuccess
callback, Link will provide a temporary public_token
.https://api.usecobalt.com/link/token/exchange
to exchange the public_token
for a permanent access_token
.access_token
and use it to make API requests./link/token/create
endpoint creates a link_token
, which is required as a parameter when initializing Link. Once Link has been initialized, it returns a public_token
, which can then be exchanged for an access_token
via /link/token/exchange
as part of the main Link flow.
client_id
this is your Cobalt API client id.client_secret
this is your Cobalt API secret.user_id
this is a unique ID representing the end user. Typically this will be a user ID number from your application. Personally identifiable information, such as an email address or phone number, should not be used in the user_id
.org_id
this is the ID of the organization that this user belongs to in your system. This is often a clinic or hospital. This association is important to handle any custom settings that an org has.</body>
tag. Make sure to attach a button’s onClick
event to call the launch_cobalt()
function. Alternatively, you can call the window.CobaltLink.init()
function directly within an event callback of your choice.
CobaltLink.init
accepts one argument, a configuration Object
. The configuration object requires the following parameters:
token
this is the temporary link_token
from the create link token step.onSuccess
this callback is called when a user successfully links their account. It takes one arguments: the public_token
. The public_token
can then be used in the exchange public token step.https://link.usecobalt.com?token={link_token}
. Once the user completes the flow they will be redirected back to your callback_url
along with the public_token
(eg. https://{YOUR_CALLBACK_URL}?token={public_token}
). You can then use the public_token
in the next step. If you haven’t set up a callback_url
yet it will default to google.com and you’ll see the token in the browser’s address bar after the redirect.
/link/token/exchange
endpoint exchanges a public_token
for an access_token
.
client_id
this is your Cobalt API client id.client_secret
this is your Cobalt API secret.public_token
this is the token acquired during the Initialize Client Link step.