Response Object
Response Object
The following apply to both Arkose Detect and Arkose Protect.
-
When enforcement or detection is completed, the configured
onCompletedfunction is invoked with aresponseobject. This applies to both Arkose Detect and Arkose Protect. -
When an error occurs in loading the detection and/or enforcement, the
onErrorcallback function is invoked with a response object. -
When the challenge is suppressed for enforcement or only detection is run, the
onSuppresscallback function is invoked with aresponseobject. -
When a warning occurs in loading the detection and/or enforcement, the
onWarningcallback function is invoked with aresponseobject. -
When a warning occurs in loading the detection and/or enforcement, the
onWarningcallback function is invoked with aresponseobject.
The following only apply to our enforcement component:
-
When a challenge has failed, the configured
onFailedfunction is invoked with aresponseobject. By "failed", we mean the user has incorrectly answered a challenge more than a configured number of times. Please contact your CSM (Customer Success Manager) or SE for additional information if needed. -
When a challenge is loaded, the configured
onResizefunction is invoked with aresponseobject. -
When a challenge is loaded, the
onShowncallback function is invoked with aresponseobject.
The following code templates suggest how to handle each function's callback and how to pass the response object or its relevant fields. It is followed by a table with descriptions of the response object's fields.
onCompleted: function(response) {
// sendToBackendServer(response.token);
},
onFailed: function(response) {
// If using APISV & response.recoverable, provide fresh token to allow reload.
// sendUserChallengeFailedToBackendServer(response.token);
},
onError: function(response) {
// sendScriptLoadingErrorToBackendServer(response.error);
},
onWarning: function(response) {
// Provide fresh APISV token so user can recover by reloading challenge.
// sendScriptLoadingWarningToBackendServer(response.warning);
},
onResize: function(response) {
// optionally handle sizing events as needed on the client-side with response.height and response.width data
},
onShown: function(response) {
// optionally handle shown event as needed on the client-side
},
onSuppress: function(response) {
// optionally handle suppressed events as needed on the client-side
}onCompleted: function(response) {
// sendToBackendServer(response.token);
},
onError: function(response) {
// sendScriptLoadingErrorToBackendServer(response.error);
},
onWarning: function(response) {
// sendScriptLoadingWarningToBackendServer(response.warning);
}Response Object Field | Type | Description | Used by Callbacks |
|---|---|---|---|
| String | The token you need to send to your back-end server for verification. |
|
| Error object | An error object containing an error code string (see next entry) |
|
| String | An error code string representing the error that occurred when loading the challenge. |
|
| String | Only applicable to our enforcement component. The challenge frame height size in px. e.g. "290px" |
|
| String | Only applicable to our enforcement component. The challenge frame width size in px. e.g. "302px" |
|
| String | Optional. Only applicable to our enforcement component. The maximum height of the challenge frame, in pixels (e.g. '450px'). |
|
| String | Optional. Only applicable to our enforcement component. The maximum width of the challenge frame, in pixels (e.g. '400px'). |
|
| Boolean | Only applicable to our enforcement component. Indicates if the challenge is completed or not. |
|
| Boolean | Only applicable to our enforcement component. Indicates if the challenge is suppressed or not. |
|
| Boolean | Indicates if the challenge is user recoverable or not. |
|
| Failed Object | A failure object containing an error code string (see next entry) |
|
| String | A error code string representing the failure that is sent from the challenge. |
|
| Warning Object | An object containing information about the warning (e.g. status, error, source). Please see the next three entries for details. |
|
| Null or String | Indicate the source of the warning. |
|
| String | A error code string representing the warning that is sent from the challenge. |
|
| Number | Optional. A status code related to the warning. |
|
Full list of error codes can be accessed from Clinet-Side Error Handling.
Updated 1 day ago