> For the complete documentation index, see [llms.txt](https://valify.gitbook.io/valify-ios-sdk-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://valify.gitbook.io/valify-ios-sdk-documentation/biometrics/android-native-sdk/sdk-response.md).

# SDK Response

### SDK Listener

Use the following code snippet to receive SDK callbacks

```java
 VIDVLivenessListener vidvLivenessListener=new VIDVLivenessListener() {
           @Override
           public void onLivenessResult(VIDVLivenessResponse livenessResponse) {
                if (livenessResponse instanceof Success) {
                
                    
                    
                //an example code to use the response in your app : 
                //this variable will have a base64 captured image during the Liveness proccess.
                String base64Image =  ((Success) livenessResponse).vidvLivenessResult.capturedImage(); 
                // Add your code here
                
                } else if (livenessResponse instanceof BuilderError) {
                
                    // Add your code here
        
                } else if (livenessResponse instanceof ServiceFailure) {
        
                    // Add your code here
            
                } else if (livenessResponse instanceof UserExit) {
            
                    // Add your code here
          
                }else if (livenessResponse instanceof CapturedActions){
            
                    // Add your code here
            
            	}
            }
    	};
```

### Response Instances&#x20;

`Success` : Process finished successfully

`CapturedActions`: Images captured are returned in real-time

{% hint style="info" %}
Note: For`CapturedImages`instance, images are not processed yet
{% endhint %}

`UserExit` : Process terminated by the user with no errors

`ServiceFailure` : Process finished with the user's failure to pass the service requirements

`BuilderError` : Process terminated due to an error in the builder

{% hint style="info" %}
Note: Check your configurations
{% endhint %}

### Primary Response Object

`VIDVLivenessResult`

{% hint style="info" %}
Note: This is the first-level object that contains all the second-level objects
{% endhint %}

### Object Body

* `facematchTransactionID` \<string>
* `facematchSuccess` \<boolean>
* `livenessSuccess` \<boolean>
* `capturedImage` \<base64-string>
* `auditRequired` \<boolean>
* `auditCaseCreated` \<boolean>&#x20;

<details>

<summary><code>hmacDataList</code> &#x3C;list></summary>

* `serviceID:` face\_match
* `hmacDigest` \<string>
* `rawResponse` \<string>

</details>

{% hint style="info" %}
The raw response in `hmacDataList` should be mapped to the result object as per the [HMAC Validation Documentation ](https://valify.gitbook.io/documentation/response-data-validation)
{% endhint %}

### Instance Responses

<mark style="color:blue;">`Success`</mark>

* `vidvLivenessResult` \<object>

<mark style="color:blue;">`CapturedActions`</mark>&#x20;

<details>

<summary><code>capturedActions</code> &#x3C;object></summary>

* `id` \<int>
* `action` \<string>
* `faceSample` \<base64-string>
* `status` \<boolean>

</details>

{% hint style="info" %}
`capturedAction` contains the images captured of the user's face during the SDK experience
{% endhint %}

<mark style="color:blue;">`UserExit`</mark>

* `vidvLivenessResult` \<sub-object>
* `step` \<string>

{% hint style="info" %}
Note: step \<string> identifies the point where the user chose to exit the SDK
{% endhint %}

<mark style="color:red;">`ServiceFailure`</mark>

* `errorCode` \<int>
* `errorMessage` \<string>
* `vidvLivenessResult` \<object>

<mark style="color:red;">`BuilderError`</mark>

* `errorCode` \<int>
* `errorMessage` \<string>
