Skip to main content
POST
Exchange the Connect Token
The x-api-key header value to be used on this API is your partner API key, which can be generated through the dashboard.
string
required
The string token passed as the first argument to your onSuccess callback after a successful Connect flow (Methods & Events). This is the exchange token produced when the transport layer completes with FLOW_SUCCESS — pass it here, not the raw connect token used to initialize the Benji Connect SDK.

Return values

integer
required
The Benji Platform ID associated with the user.
integer
required
Your system ID as specified on the Benji Platform.
object
required
An object representing the access_token, refresh_token to use when using the Benji Platform APIs as well as the access token expiry date. Once an access token expires, you can use the refresh token to obtain a new access token silently without requiring the user to authenticate again.
Access tokens are typically valid for 90 days. You can refresh an access token either before it expires proactively, or after calling an API and getting an expired_token 401 status code.
Call the Exchange Token API soon after onSuccess. The exchange token is valid for 15 minutes after the successful callback.
See also Methods & Events in the Benji Connect SDK docs for the shape of onSuccess metadata alongside the token.