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.

NameTypeMandatoryDescription
requestIdStringYesRequest 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().
requestBodyStringYesRequest body to be sent to Personetics server

Mobile Layout Params

iOS Swift Params

NameTypeMandatoryDescription
onSuccessCallBackYesCallback to return success response from server
onErrorCallBackYesCallback to return the error response from server
paramsStringYesString of the parameters returned from the server call

Android Params

NameTypeMandatoryDescription
requestIdStringYesRequest 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().
requestBodyStringYesRequest body to be sent to Personetics server

React Native Params

NameTypeMandatoryDescription
webViewStringYesWebView of the app – used to inject data
requestBodyParamsMapYesRequest body to be sent to Personetics server
contextMapYesApp context containing the startWidget configuration

Flutter Params

NameTypeMandatoryDescription
contextBuildContextYesThe build context of the webView widget.
requestBodyParamsMap<String,dynamic>YesRequest 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

NameTypeMandatoryDescription
ResponseStringYesPersonetics server response
requestIdStringYesThis 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

NameTypeMandatoryDescription
requestIdStringYesRequest 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().
requestBodyStringYesRequest body to be sent to Personetics server

OBServer Functions

FunctionDescription
getBankConfigurationFirst API in the flow. Returns all assets (text and images) from the server.
getAccountsReturns list of all user accounts.
getFinancialInstitutionsText input API for searching for specific financial institutions (during onboarding).
ConnectLiteReturns a connection link to complete the onBoarding flow on the external FI.
deleteAccountByInstituionLoginIdUnlinks all accounts related to a specific login id.
refreshTimeThe response will include information on each institution-login onboarding status and dates for specific user.