Get IDV Configurations
API: getIDVConfig
š Overview
The getIDVConfig API is used to fetch the current IDV configurations from the Ditto ID Gateway server. These configurations govern how the IDV SDK behaves during document scanning and selfie capture.
š¤ Response
The API returns a JSON object containing two top-level keys:
error: A standard RDNAError JSON object withshortErrorCode,longErrorCode, anderrorString.response: A JSON object with current IDV configuration values.
Sample Response:
{
"error": {
"longErrorCode": 0,
"shortErrorCode": 0,
"errorString": "Success"
},
"response": {
"selectedDatabaseId": "India",
"databaseDetail": [
{ "id": "India", "description": "India", "status": 0 },
{ "id": "Jordan", "description": "Jordan", "status": 0 },
{ "id": "FullDB", "description": "FullDB", "status": 0 }
],
"nfcScanEnabled": true,
"nfcScanTimeOut": 30,
"authenticityChecksEnabled": true,
"hologramCheckEnabled": true,
"saveDebugLogs": false,
"saveCroppedImages": true,
"version": "3.0",
"supportedVersions": ["3.0"],
"isRawDataRequired": false,
"useDefaultDatabase": true
}
}š Field Descriptions
| Field | Type | Description |
|---|---|---|
selectedDatabaseId | string | Currently selected database |
databaseDetail | array | List of available databases with id, description, status |
nfcScanEnabled | boolean | Enables NFC scanning for supported documents |
nfcScanTimeOut | int | Timeout value for NFC scan (recommended 20-60) |
authenticityChecksEnabled | boolean | Enable or disable document authenticity checks |
hologramCheckEnabled | boolean | Enable or disable hologram checking |
saveDebugLogs | boolean | Save debug logs to sandbox |
saveCroppedImages | boolean | Save cropped document images locally |
version | string | Current config version (e.g., "3.0") |
supportedVersions | array | List of supported config versions |
isRawDataRequired | boolean | Enable raw data sharing from SDK to app |
useDefaultDatabase | boolean | Use default bundled database or download via setIDVDatabaseID |
š§Ŗ Notes
- Use this configuration to dynamically control the behavior of document scanning and selfie capture.
- The configuration can be updated using the
setIDVConfigAPI.
Code Snippets for getIDVConfig
getIDVConfigReact Native
RdnaClient.getIDVConfig((response) => {
if (response.error.shortErrorCode === 0) {
console.log('Config:', response.response);
} else {
console.error('Error fetching config:', response.error.errorString);
}
});Flutter
rdna.getIDVConfig().then((response) {
if (response['error']['shortErrorCode'] == 0) {
print('Config: ${response['response']}');
} else {
print('Error: ${response['error']['errorString']}');
}
});Cordova
com.uniken.rdnaplugin.RdnaClient.getIDVConfig(
function(response) {
if (response.error.shortErrorCode === 0) {
console.log('Config:', response.response);
} else {
console.error('Error:', response.error.errorString);
}
},
function(error) {
console.error('API call failed:', error);
}
);Native Android
String result = rdnaClient.getIDVConfig();
JSONObject json = new JSONObject(result);
JSONObject error = json.getJSONObject("error");
if (error.getInt("shortErrorCode") == 0) {
JSONObject config = json.getJSONObject("response");
Log.d("IDVConfig", config.toString());
} else {
Log.e("IDVConfig", error.getString("errorString"));
}Native iOS
NSString *result = [self.rdnaClient getIDVConfig];
NSData *data = [result dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
NSDictionary *error = json[@"error"];
if ([error[@"shortErrorCode"] intValue] == 0) {
NSDictionary *config = json[@"response"];
NSLog(@"Config: %@", config);
} else {
NSLog(@"Error: %@", error[@"errorString"]);
}Updated 4 months ago
