Send Request to Server
This page details the following event handler functions:
- sendRequestToPServer*
- handlePServerResponse (informational - does not require configuration)
- sendRequestToEnrichServer*
- sendRequestToOBServer
Each function includes description per layout.
The end-point of each relevant server must be defined. For Engage: sendRequestToPserver
*Function implementation and parameter descriptions are the same, only the servers differ: PServer vs EnrichServer
sendRequestToPServer
This section describes the parameters for sendRequestToPServer; however, the same parameters apply to sendRequestToEnrichServer.
Note the following:
- sendRequestToPServer - invoked by Personetics widget when an HTTP request is made to the Personetics server
- sendRequestToEnrichServer - invoked by Personetics widget when an HTTP request is made to the Enrich server
- Personetics does not handle any direct HTTP request to either server. All calls should be made via the bank secured channel using the bank’s application code.
- The bank should add a header named “authToken” to any request to either server. This header holds a unique ID that will be used by the Personetics server to identify the user.
- The parameters vary per layout.
Web Layout Params
These parameters are relevant to the following web layouts: Web Vanilla JS, Web React JS, and Web Angular JS.
Name | Type | Mandatory | Description |
---|---|---|---|
requestId | String | Yes | Request unique identifier. This property value is required when calling handlePServerResponse – the reply message received from Personetics server. The bank should save this value and return it with the response using “handlePServerResponse(). |
requestBody | String | Yes | Request body to be sent to Personetics server |
Mobile Layout Params
iOS Swift Params
Name | Type | Mandatory | Description |
---|---|---|---|
onSuccess | CallBack | Yes | Callback to return success response from server |
onError | CallBack | Yes | Callback to return the error response from server |
params | String | Yes | String of the parameters returned from the server call |
Android Params
Name | Type | Mandatory | Description |
---|---|---|---|
requestId | String | Yes | Request unique identifier. This property value is required when calling handlePServerResponse – the reply message received from Personetics server. The bank should save this value and return it with the response using “handlePServerResponse(). |
requestBody | String | Yes | Request body to be sent to Personetics server |
React Native Params
Name | Type | Mandatory | Description |
---|---|---|---|
webView | String | Yes | WebView of the app – used to inject data |
requestBodyParams | Map | Yes | Request body to be sent to Personetics server |
context | Map | Yes | App context containing the startWidget configuration |
Flutter Params
Name | Type | Mandatory | Description |
---|---|---|---|
context | BuildContext | Yes | The build context of the webView widget. |
requestBodyParams | Map<String,dynamic> | Yes | Request body to be sent to Personetics server |
Return value- none
handlePServerResponse
This function is relevant to all servers.
General Description
- The bank calls this function as a response to the sendRequestToPServer, sendRequestToEnrichServer, and sendRequestToOBServer event sent by Personetics.
- Personetics calls the “sendRequestToPServer” function for each HTTP request.
- The response received by the Personetics server should be passed to Personetics using this function.
Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
Response | String | Yes | Personetics server response |
requestId | String | Yes | This property needs to be attached to the reply of each call. |
Return value None
sendRequestToEnrichServer
sendRequestToEnrichServer - invoked by Personetics widget when an HTTP request is made to the Enrich server. Refer to o sendRequestToPServer for the parameter descriptions per layout.
sendRequestToOBServer
Note the following:
- Personetics widget invokes this function when an HTTP request is made to the OB server.
- Personetics does not handle any direct HTTP request to the OBServer. All calls should be made via the bank secured channel using the bank’s application code.
- The bank should add a header named “authToken” to any request to either server. This header holds a unique ID that will be used by the Personetics server to identify the user.
The function supports two arguments:
- requestBodyParams:Object - This is an object type argument that contains the type of request events to map by requestBodyParams.type
- handleSendRequestToOBServer: Function - This is a function type argument, that returns the data json to the widget
Return value: None
Name | Type | Mandatory | Description |
---|---|---|---|
requestId | String | Yes | Request unique identifierThis property value is required when calling handlePServerResponse – the reply message received from Personetics server.The bank should save this value and return it with the response using “handlePServerResponse(). |
requestBody | String | Yes | Request body to be sent to Personetics server |
OBServer Functions
Function | Description |
---|---|
getBankConfiguration | First API in the flow. Returns all assets (text and images) from the server. |
getAccounts | Returns list of all user accounts. |
getFinancialInstitutions | Text input API for searching for specific financial institutions (during onboarding). |
ConnectLite | Returns a connection link to complete the onBoarding flow on the external FI. |
deleteAccountByInstituionLoginId | Unlinks all accounts related to a specific login id. |
refreshTime | The response will include information on each institution-login onboarding status and dates for specific user. |
Updated 10 months ago