Mobile App Integration

Platforms who want to use Chatbot in their iOS or Android app can integrate using Webview. Instead of passing Chatbot configurations via a client-side Javascript call, Webview integration passes those configurations via query string. Communication between the mobile app and the Webview is handled by HTTP redirects.

The initialization URL is optimized for WebViews:

During Chatbot configuration, you must pass a URL-encoded JSON object with the following URL parameters:

ParameterDescriptionSupported Project
defaultPath[Required] 'Router' For Chatbot Router
'CARDS' For Card Management
'BANK_LOGINS' For Linking Bank Credentials
'INTERCHANGE' For Linking/Unlinking Cards
Bank Logins, Interchange, Card Management, Router
env[Required] The Synapse API environment on which to create user accounts. For development use UAT, and use production for Production.Bank Logins, Interchange, Card Management, Router
publicKey[Required] A valid public keyBank Logins, Interchange, Card Management, Router
fp[Required] A valid device fingerprint. See Register New Fingerprint API.Bank Logins, Interchange, Card Management, Router
userId[Required] The ID of the userBank Logins, Interchange, Card Management, Router
isWebView[Required] trueBank Logins, Interchange, Card Management, Router
institution[Optional] This will skip the Step[selectBank] step and go straight to Step[sendCredential] based on the [bank_code] passed. Eg, ‘bofa’.Bank Logins

Below is an example of how clients might generate the link to put in the Webview.

https://(uat-)uiaas-v2.synapsefi.com/chatbot-router //selected project url
?publicKey=[SYNAPSE_PUBLIC_KEY]
&fp=[SYNAPSE_USER_FINGERPRINT]
&userId=[SYNAPSE_USER_ID]
&isWebView=true
&defaultPath=ROUTER
&env=UAT

To communicate between Chatbot Bank Logins and your app, we have similar functions as we have for desktop integration. Instead of calling as a javascript callback function, the event type is communicated via the URL host and data is passed via the query string.

Exit event

The exit event is similar to the onExit callback and is sent when the user exits the chatbot. The following information is available from the query string:

ParameterDescriptionSupported Project
userIdID of the userBank Logins, Interchange, Card Management
step_nameThis indicates the point at which the user exited the chatbotBank Logins, Interchange, Card Management
typeType of this eventBank Logins, Interchange, Card Management

The following information is available from the query string as an example:

Success event

The success event is similar to the onSuccess callback and is sent when the user successfully linked the bank accounts through the chatbot. The following information is available from the query string:

ParameterDescriptionSupported Project
userIdId of the userBank Logins, Interchange, Card Management
step_nameThis indicates the point at which the user successfully made an actionBank Logins, Interchange, Card Management
typeType of this eventBank Logins, Interchange, Card Management
linkedNodeA list of nodes_id stringsBank Logins, Interchange
unlinkedNodeA list of nodes_id stringsInterchange
institution_nameThe full institution name (e.g. "Bank of America")Bank Logins
cardCard information (status) if it was modifiedCard Management

Error event

The error event is similar to the onError callback and is sent when the user faced the error when using chatbot. The following information is available from the querystring:

ParameterDescriptionSupported Project
userIdID of the userBank Logins, Interchange, Card Management
error_codeThe error code that the user encountered, see Common ErrorsBank Logins, Interchange, Card Management
http_codeThe http code of error that the user encountered, see Common ErrorsBank Logins, Interchange, Card Management
error_messageThe error message that the user encounteredBank Logins, Interchange, Card Management
timeThe timestamp when the error happenedBank Logins, Interchange, Card Management
step_nameThis indicates the point at which the user encountered the errorBank Logins, Interchange, Card Management
typeType of this eventBank Logins, Interchange, Card Management
institution_nameThe full institution name (e.g. "Bank of America")Bank Logins, Interchange, Card Management
chatbot://exit
?userId=’string’
&step_name= ‘string’,
&type=’exit’
chatbot://success
?userId=’string’
&step_name= ‘string’
&type=’success’
&linkedNode=’node_id_string1’, ’node_id_string2’ (if more than one node)
&unlinkedNode=’node_id_string1’, ’node_id_string2’ (if more than one node)
&institution_name=’string’
&card=’string’
chatbot://error
?userId=’string’
&step_name= ‘string’
&type= “error”
&error_code=  ‘string’
&http_code= ‘string’
&error_message= ‘string’
&institution_name=’string’
&time=”string”

WebView examples

To get your Link WebView integration started, check out our example apps, available for iOS.
Example app is runnable (on both simulators and devices) and includes code to initialize Link and process events sent from Link to your app via HTTP redirects.