initialize
POST /api/v1/zoloz/connect/initialize
The ZOLOZ Connect initialize API is used to initialize the face verification process in ZOLOZ. A unique transaction ID is generated for the process and used in all the subsequent interactions with the ZOLOZ server. This API is not idempotent.
Structure
Request parameters
Field name | Data type | Max length | Description |
bizId | String | 32 | Required. A unique business ID for tracing purposes. For example, the sequence ID from the merchant's business-related database. Note: The ZOLOZ server does not perform uniqueness check on the value of this field. For better tracking, it is strongly recommended to enable the merchant server to guarantee the uniqueness of the business ID. |
metaInfo | String | 512 | Required. The meta information about the SDK and the user's device. The value of this field is returned from the ZOLOZ SDK in JSON string format, for example:
Note: Do not modify the returned value as it only needs to be passed through directly. |
userId | String | 64 | Required. Merchant user ID, or other identifiers that can be used to identify a specific user. For example, mobile phone number, email address and so on. It is strongly recommended to pre-desensitize the value of the userId field; for example, by hashing the value. |
sceneCode | String | 64 | Optional. Specifies the business scene for data analysis purpose. If you want to distinguish the data performance of different scenes, it is recommended to set the sceneCode field to different values according to your business purpose; for example, login, riskVerify, payment, changePassword. |
serviceLevel | String | 32 | Optional. Specifies the service level for face liveness detection. The following values are supported:
Note: H5 mode connect does not support serviceLevel. |
operationMode | String | 32 |
Note: H5 Mode connect does not support operationMode |
h5ModeConfig | H5ModeConfig | Optional. Specifies the configuration settings for H5 mode. For more information, refer below to the h5ModeConfig section. | |
productConfig | ProductConfig | Optional. Specifies finer controls on the Connect product. For more information, see productConfig. Note: If productConfig, serviceLevel and operationMode are set together at the same time, neither the serviceLevel nor the operationMode will take effect. This is due to these parameters being in conflict. Instead, ZOLOZ will only read productConfig. |
Response parameters
Field name | Data type | Description |
result | Required. The API request result, which contains information about the result of the API request, such as status and error codes. | |
transactionId | String | Optional. A unique transaction ID that is generated by the ZOLOZ server for the face verification process. This ID will be used as an input parameter for the Connect checkresult API request. Note: when an error occurs during the process, for example, invalid argument, no transaction ID is returned. |
clientCfg | String | Optional. The client configuration information, including parameters about SDK connection and behavior. The value of this field is specified only when the result.resultStatus field is |
Result
Result process logic
For different request results, different actions are to be performed. See the following for details:
- If the value of the result.resultStatus is
S
, the ZOLOZ Connect initialize API is invoked successfully and a unique transaction ID is returned. - If the value of the result.resultStatus is
F
, the invocation of the ZOLOZ Connect initialize API fails. Check the error code and message for more information about the possible reasons.
Common error codes
For the full list of common error codes, see the Common error codes section in the Error handling topic.
API-specific error codes
The following table shows the possible error codes that are specific for the Connect initialize API.
resultCode | resultStatus | Description |
SUCCESS | S | The API call is successful. |
UNABLE_GET_IMAGE | F | No reference source is found (caused by attempting to verify before enroll). |
HIGH_RISK | F | High risks are detected. The user account is strategically cooled down by the risk engine. |
ACCOUNT_SERVICE_SUSPEND | F | The user account is blacklisted by the risk engine. |
DEVICE_NOT_SUPPORT | F | The device type is not supported. |
OS_NOT_SUPPORT | F | The operating system of the device is not supported. |
SDKVERSION_NOT_SUPPORT | F | The version of the ZOLOZ SDK is not supported. |
INVALID_ARGUMENT | F | Input parameters are invalid. For more information about which parameter is invalid, check the result message or the related log. |
SYSTEM_ERROR | F | Other internal errors. For more information about the error details, check the result message that is returned and the related log. |
Sample
For different integration modes, the request structures are a little different. When the connect process is initiated in the H5 mode, additionally, an object called h5ModeConfig must be specified.
Refer to the following two request samples for the detailed information.
Native Connect Request Sample
The following sample shows what a request sent from the merchant server looks like.
{
"bizId":"test-bizId",
"metaInfo": "{\"apdidToken\":\"69b74bfe-bf7f-4d3b-ac59-907ee09e7955\",\"appName\":\"com.zoloz.atomic.client\",\"appVersion\":\"1.0.9\",\"bioMetaInfo\":\"3.46.0:2916352,0\",\"deviceModel\":\"MI 6\",\"deviceType\":\"android\",\"osVersion\":\"9\",\"zimVer\":\"1.0.0\"}",
"userId":"dummy_userid_1626180988600",
"productConfig": {
"livenessMode":"STANDARD",
"antiInjectionMode":"CLOSED",
"actionCheckItems":["FACEBLINK","HEADLOWER"],
"actionRandom":"Y",
}
}
H5 Connect Request Sample
The following sample shows what a request looks like if the connect process is initiated in the H5 mode.
{
"bizId":"dummy_bizid_1626180988600",
"metaInfo":"MOB_H5",
"userId":"dummy_userid_1626180988600",
"h5ModeConfig":{
"completeCallbackUrl":"http://xxx/result.html",
"interruptCallbackUrl":"http://xxx/result.html"
},
"productConfig": {
"livenessMode":"STANDARD",
"antiInjectionMode":"CLOSED",
"actionCheckItems":["FACEBLINK","HEADLOWER"],
"actionRandom":"Y",
}
}
Response Sample
The following sample shows what a response that the ZOLOZ server returns looks like.
{
"result": {
"resultStatus": "S",
"resultCode": "SUCCESS",
"resultMessage": "Success"
},
"transactionId":"G006600016CN20190114000000009572520355",
"clientCfg": "……"
}
More information
h5ModeConfig
The following table shows the fields that can be specified in the h5ModeConfig data model.
Field name | Data type | Max length | Description |
state | String | 128 | Optional. An identifier that is used to recover the customer's context. You can set this field to any String value. The value is then passed as a parameter when the ZOLOZ SDK calls back to the merchant's application. If the value is not set, the value of the transactionId field is used. |
completeCallbackUrl | String | 128 | Required. Specifies the callback URL where the browser is redirected when the whole identity proofing process is completed. |
String | 128 | Required. Specifies the callback URL where the browser is redirected when the process is interrupted. | |
locale | String | 16 | Optional. Language of the web page, only supports: en/ id/ zh-CN at the moment. The default language is en. |
String | 1 | Supported Value: Y / N | |
uiCfg | String | 256 | Optional. Custom UI configurations in the JSON string format. Some example fields that are supported: titlebarbgcolor, titlebartextcolor, and buttoncolor, etc. Such as in:"{\"titleBackgroudColor\": \"#0064FF\",\"titleTextColor\": \"#FFFFFF\",\"topTipColor\": \"#0064FF\"}". Supports the configuration of related JSON files on the portal. |
productConfig
The following table shows the fields that can be specified in the productConfig data model.
Field name | Data type | Max length | Description |
livenessMode | String | 10 | Optional. Specifies the liveness level for face liveness detection check. The following values are supported:
|
String | 10 | Optional. Specifies the anti-injection level for injection attack detection. Injection attack detection can effectively resist injection attacks using deepfakes i.e. face-swapping pictures or videos. The following values are supported:
Note: Enabling injection attack detection will slightly increase false rejection rate and runtime. Please contact ZOLOZ technical support team before turning on this function. | |
actionCheckItems | List<String> | Optional. User actions to be detected. For better user experience, it is not recommended to use two or more actions. The following values are supported:
| |
actionRandom | String | 1 | Optional. Specifies whether user actions specified in
|