Error Response Format


The Assessment APIs returns custom error messages for invalid requests in addition to HTTPS codes. The failed response contains some properties. These properties and their values are more indicative of the underlying error.

Error Response Syntax


{
    "error": {
        "error_code": "unique_error_code",
        "display_message": "Display message for the user",
        "message":  "Actual error message from the server"
    }
}

Error Fields


The Error field represent an error occurred while processing the request. It contains a list of errors. Developers can identify the request is not succeeded based on this field. Here is the the example of response in case of missing field in the request body.

{
    "error": {
        "error_code": "missing_field",
        "display_message": "Uh huh, you missed a required field",
        "message": "Missing required field - gender"
}

Here is the description of each error fields present in above error body

FieldDescription
error_codeThis field represent a custom error code to distinguish between different kind of errors. These error codes are custom and are our platform specific. You can see more about error_code in next section.
display_messageError display message for the user.
messageThe actual error message from the server.

Error Codes


These are the custom error code field present in failure response body. There can be various factor that can cause the request to fail. Sometimes this kind of errors needs to be grouped according the the reason of failure. This allows developers to diagnose the errors faster.

List of Error Codes


Here is the list of most common error codes that can be returned by the API.

error_codemessagedisplay_message
invalid_api_routeInvalid API Route -Uh huh, no resource found at this URL, Please check the URL and try again
missing_fieldMissing required field -Uh huh, you missed a required field
empty_fieldThis field cannot be empty -Uh huh, a field is expecting some data in it, Please enter valid data.
invalid_field_valueThis field value is invalid -Uh huh, You have entered invalid value for a field
invalid_field_choiceInvalid choice value -Uh huh, You have entered wrong choice for a field
unknown_errorUnknown errorIt’s not you, It’s us! We will try to fix this soon.
validation_errorValidation error -Uh huh, something went wrong while validating your request. Please check your requst data and try again
internal_server_errorInternal server error -It’s not you, It’s us! We will try to fix this soon.
unsupported_workflow_idUnsupported workflow ID -Uh huh, the requested workflow ID is not supported
unsupported_ageAge not supportedUh huh, your age should be between 12 to 130 to use this feature
unsupported_genderGender not supportedUh huh, we only support male or female gender at this time.
invalid_dobInvalid date of birth formatDate of birth is invalid. Please provide a valid date in format YYYY-MM-DD
unsupported_componentInvalid component code -It’s not you, It’s us! We will try to fix this soon.
invalid_auth_tokenInvalid auth tokenUh huh, your Authentication token is invalid. Please provide a valid token
invalid_api_versionInvalid API version -Uh huh, the requested API version is not supported
invalid_assessment_typeInvalid assessment type. Supported - [SA, SN], got -Uh huh, the something went wrong from our side, the assessment type is invalid
invalid_assessment_stageInvalid Assessment Stage -Uh huh, something went wrong from our side, the interview cannot start and submit at the same time
invalid_qualifier_valueInvalid Qualifier Value. Supported values-[p, a, u], got -Uh huh, the qualifier value is invalid
invalid_question_numberInvalid question number -Uh huh, the question number is invalid
cache_not_foundSa init cache-date empty/not-found -Uh huh, this assessment session is expired, please start a new assessment
assessment_ownership_mismatchThe assessment does not belong to you -The assessment does not belong to you