Request

Request Signature:

  • URL: https:/execute
  • Method: POST (keepalive request is supported as a GET method as well)
  • Content Encoding: utf-8
  • Content Type: application/json

Request Parameters

ParameterLocationDescriptionMandatoryDefault
bodyBodyThe request body holds a raw UTF-8 encoded string representing a Command ObjectYesN/A
authTokenHeaderA secure authentication tokenYesN/A
bankIdHeaderThe financial institution identifier – will be documented in reporting tablesNoNull
channelRequest ParameterThe name of the channel sending the command.YesN/A

Command Object

Commands are passed as standard JSON objects with the following common fields:

ParameterDescriptionMandatoryDefaultType
typeSpecifies the type of command to execute. Each command is identified by a unique string constant.YesN/AString
protocolVersionVersion number of command protocol - currently 2.6.YesN/AString
clientVersionVersion number of client code that is calling the API (Personetics widget version\bank client version, depends on the caller)NonullString
langThe language in which the texts fields will be returned.NoEnglishString
bankSessionIdWhen running getInsights or getNumberOfInsights on a session where insights where already generated on, the request will not run the DI process or generate insights again. Furthermore, the bankSessionId appears in the Personetics logs and reporting tables to allow full tractability of the user activity across systems.NonullString
hintsA JSON object with arbitrary data hints to accompany the command. The structure and content of the data hints is flexible and can be set for each project independently.NoNullobject

The Command JSON may include additional fields relevant to specific command types. A sample command in JSON format:

{ 
"type": "getInsights", 
"protocolVersion": "2.6", 
"ctxId": "sampleTopRelevant", 
"lang": "en",
"bankSessionId": "62c2132b-a731-4da3-b6cc-8255fcb52219", 
"hints": { ... } 
}

Command Wrapper

The request command wrapper has three main properties:

ParameterDescriptionMandatoryType
typeAlways has the constant ‘cmdWrapper’.yesString
cmdContains the list of properties of the original request. For example, in the request type ‘getInsights’, the ‘cmd’ property will include all the properties used by original ‘getInsights’ request.yesObject
hintsContains the hints which is JSON object.noObject

Sample command in JSON format:

{ 
"type": "cmdWrapper", 
"cmd": { 
	"type": "getInsights", 
		"protocolVersion": "2.6", 
		"clientVersion": "2.4.X", 
		"ctxId": "sampleTopRelevant",
		"bankSessionId": "62c2132b-a731-4da3-b6cc-8255fcb52219", 
		"lang": "en" 
			}, 
"hints": {"partyData64":"..."} 
}

Authentication Token

Personetics uses secure authentication tokens for single-sign-on with bank systems. The key role of the authentication token is to securely identify the end user for the command.

The following authentication options are available:

  • Clear text – The user ID is provided as a clear text HTTP header. This is the simplest form of authentication that is often used for early development stages. Note that when encrypted, communication is used (such as mutual SSL encryption). This approach poses no security risks. This option is enabled by default.
  • Java Web Tokens – User information is provided using the signed JSON objects according to the JWT standard. Personetics servers should be configured with a shared secret and the name of the user ID field in order to use this authentication option.
  • Custom – User information is provided according to a custom schema defined by the bank. In many cases, this involves custom encryption using shared secrets and keys. Using this option requires custom configuration of Personetics servers in order to enable them to extract user information form the custom token.