Retrieving Transaction Data with the Java Library
JumioClient has two retrieveData()
methods for retrieving transaction data.
-
public WorkflowExecutionResponse retrieveData(CallbackRequestBody callbackRequestBody)
Use this method when you are Implementing a Callback Service. -
public WorkflowExecutionResponse retrieveData(UUID accountId, UUID workflowExecutionId)
Use this method to retrieve data using the account ID and workflow execution ID.
Both methods return a WorkflowExecutionResponse object containing the data corresponding to the values returned by calling the Retrieval REST APIs (See Calling Retrieval APIs).
For example, the following snippet accesses the capabilities executed by the transaction and uses a convenience method called extractNonPassedCapabilities to print out the decision details label for any capabilities that have a decision:type value other than "PASSED":
@GetMapping(path = "/{acctId}/{transId}") String returnReason(@PathVariable String acctId, @PathVariable String transId) { JumioClient jumioClient = applicationContext.getBean(JumioClient.class); WorkflowExecutionResponse details = jumioClient.retrieveData(UUID.fromString(acctId), UUID.fromString(transId)); WorkflowExecutionResponseCapabilities capabilities = details.getCapabilities(); return jumioClient.extractNonPassedCapabilities(capabilities); }
Calling this endpoint with the account ID and workflow execution ID of a transaction for which the imageChecks capability returned a decision:type value of "WARNING" would return a string such as this:
[imageChecks: WARNING,REPEATED_FACE]
WorkflowExecutionResponse provides a variety of methods for accessing the transaction decision, credentials, capabilities, rules, and other values for the transaction.