During integration and testing, a situation often arises where some services, for example, kisc (TSOID) or other government systems, are not yet available to you. In such cases, it becomes necessary to simulate (mock) their responses. In addition, simulating the operation of services is convenient when you need to get a specific result that is hard to reproduce in a test environment (for example, a positive response from verilive or specific document scanning results).
You can manage (create and delete) simulations through the API. You can view the specification here.
During Flow execution, the result you passed using this method will be substituted when it is time for the service to run. This result is tied to a specific person_id and will be used only for that person_id.
curl -X POST "https://services.kz-ala-1.verigram.kz/mockery/result"
-H "X-Verigram-Api-Version: 2.1.0" \
-H "X-Verigram-Api-Key: REPLACE_WITH_YOUR_API_KEY" \
-H "Accept: application/json" \
--data "@/path/to/verilive_mock.json"
The content of the JSON file could look like this:
{
"person_id": "test-person",
"result": {
"service_name": "verilive",
"service_status": "real"
},
"files": {
"bestframe": "base64 encoded face image"
}
}Service veridoc:
{
"person_id": "test-person",
"result": {
"service_name": "veridoc",
"service_status": "success",
"document": {
"address": null,
"face_picture": null,
"first_name": "АМАНЖОЛ",
"first_name_en": null,
"first_name_tr": null,
"last_name": "АМАНЖОЛОВ",
"last_name_en": null,
"last_name_tr": null,
"middle_name": "АМАНЖОЛОВИЧ",
"patronymic": null,
"full_name": null,
"personal_number": null,
"id_number": "045900156",
"identifier": null,
"doc_number": null,
"doc_code": null,
"state_code": null,
"iin": "881022300093",
"birth_date": "22101988",
"birth_place": "ЖАМБЫЛСКАЯ ОБЛ.",
"doc_type": "1",
"issue_date": "30072019",
"issuer": "МВД РЕСПУБЛИКИ КАЗАХСТАН",
"due_date": "29072029",
"ethnicity": "КАЗАХ",
"gender": "M",
"nationality": "КАЗАХСТАН",
"mrz": "IDKAZ0459001568881022300093<<<8810221M2907295KAZ<<<<<<<<<<<0AMANZHOLOV<<AMANZHOL<<<<<<<<<<<<",
"mrz_1": "IDKAZ0459001568881022300093<<<",
"mrz_2": "8810221M2907295KAZ<<<<<<<<<<<0",
"mrz_3": "AMANZHOLOV<<AMANZHOL<<<<<<<<<<<<",
"mrz_birth_date": "881022",
"mrz_check_digit_1": "8",
"mrz_check_digit_2": "1",
"mrz_check_digit_3": "5",
"mrz_check_digit_4": "0",
"mrz_check_digit_5": null,
"mrz_country": "KAZ",
"mrz_doc_code": "ID",
"mrz_doc_number": "045900156",
"mrz_due_date": "290729",
"mrz_first_name": "AMANZHOL",
"mrz_first_optional": "881022300093",
"mrz_full_td1": "IDKAZ0459001568881022300093<<<$8810221M2907295KAZ<<<<<<<<<<<0$AMANZHOLOV<<AMANZHOL<<<<<<<<<<<<",
"mrz_gender": "M",
"mrz_iin": "881022300093",
"mrz_last_name": "AMANZHOLOV",
"mrz_nationality": "KAZ",
"mrz_optional_data": null,
"mrz_second_optional": ""
}
},
"files": {
"doc_face_picture": "base64 encoded face image"
}
}Service flow-form:
{
"person_id": "test-person",
"result": {
"service_name": "flow-form",
"service_status": "filled_out",
"address_t1": {
"country_code": "KAZ",
"region": "Region",
"region_code": "05",
"city": "City",
"city_code": "02",
"street": "Street",
"building": "111",
"apartment": "1"
}
}
}