Test Run a Kiosk

Purpose

The Test Run feature allows you to test the execution of your Kiosk before publishing it in Zoho CRM. It executes all configured states and actions, enabling you to validate the Kiosk flow. Any operations that create, update, or delete records are performed on your CRM data.

The Test Run executes all configured Kiosk actions on live CRM data. Actions such as sending email notifications and creating, updating records are performed in real time. These changes are not simulated and cannot be automatically reversed.

This API initiates the Test Run and returns the first state of the Kiosk. To continue executing the remaining states, invoke the Update Kiosk Execution API using the details returned in the response until the Test Run is completed.

Prerequisite:
To obtain the Kiosk ID required for this request, use the Get Kiosks API.

Note
Availability: Standard, Professional, Enterprise, and Ultimate editions.

Permission Required: Administrator profile, or profiles with either the Module Customization or Manage Automation  permission enabled.

Endpoints

  • POST /settings/kiosks/{kiosk_ID}/actions/test_run
  • {kiosk_ID} : The unique ID of the Kiosk to run in test mode.

Request Details

Request URL

{api-domain}/crm/{version}/settings/kiosks/{kiosk_ID}/actions/test_run

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

ZohoCRM.settings.kiosks.ALL 
(or) 
ZohoCRM.settings.kiosks.CREATE

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v8/settings/kiosks/111111000000124466/actions/test_run"
-X POST
-d "@input.json"
-H "Authorization: Zoho-oauthtoken 1000.xxxxxxxxxxxxx"

Input JSON

The request body must be a JSON object with a kiosk_test_run array. Each object in the array can include the following:

  • dataJSON object, optional

    Specify the data context for the current test run execution.

    • Current_RecordJSON object, optional

      The Current_Record field provides the record context for the kiosk test run.

      • idstring, optional

        Specify the id of current record. Refer Get records API for record details.

Note

If the Current_Record is not provided, any Kiosk state elements that reference the current record, such as merge fields, Get Records elements configured to use the current record, or actions such as field updates on the current record, will return empty values.

Sample Input

Copied{
    "kiosk_test_run": [
        {
            "data": {
                "Current_Record": {
                    "id": "5039614000000782064"
                }
            }
        }
    ]
}

Response JSON

The response body is a JSON object containing a kiosk_test_run array. Each object in the array contains the following fields:

  • code string

    The status code of the test run operation.

  • details object

    Contains detailed information about the test run execution.

    • next_executable_stateJSON object

      Contains information about the next state that can be executed in the kiosk flow.

      • namestring

        The display name of the next executable state.

      • idstring

        The unique identifier of the next executable state.

    • executed_dependent_statesJSON array

      An array of dependent states that were executed during the test run. Each object contains information about the state and the transition taken.

      • namestring

        The display name of the executed dependent state.

      • idstring

        The unique identifier of the executed dependent state.

      • transitionJSON object

        Contains information about the transition taken from this dependent state.

        • namestring

          The display name of the transition taken.

        • idstring

          The unique identifier of the transition taken.

    • idstring

      The unique identifier of the test run execution record.

  • messagestring

    A descriptive message about the test run operation result.

  • statusstring

    The status of the test run operation.

Note

  • Any actions configured in the Kiosk like, sending email notifications, will be executed on real-time data during the Test Run.
  • A test run can be performed on both draft and published versions of the kiosk.

Possible Errors

  • INVALID_DATA HTTP 400
    • No such Kiosk exists.
      Resolution: Specify a valid Kiosk ID in the request URL. You can get the list of valid Kiosk IDs using the Get Kiosk API.

    • Invalid current record.
      Resolution: Specify a valid CurrentRecord ID in the request URL. You can get the list of valid record IDs using the Get Records API.

  • MANDATORY_NOT_FOUND HTTP 400

    Required field not found
    Resolution: Specify kiosk_test_run array in request body. Check the Input JSON section.

  • OAUTH_SCOPE_MISMATCH HTTP 401

    Invalid oauth scope to access this URL.
    Resolution: Create a new token with the required scopes. Refer to the scope section.

  • AUTHENTICATION_FAILURE HTTP 401

    Authentication Failed.
    Resolution: Pass the access token in the request header of the API call.

  • INVALID_URL_PATTERN HTTP 404

    Please check if the URL trying to access is a correct one.
    Resolution: Specify valid URL. Check the Endpoints section.

Sample Response

Copied{
    "kiosk_test_run": [
        {
            "code": "SUCCESS",
            "details": {
                "next_executable_state": {
                    "name": "Screen 1",
                    "id": "5039614000000951848"
                },
                "executed_dependent_states": [
                    {
                        "name": "Decision 1",
                        "id": "5039614000000951843",
                        "transition": {
                            "name": "Path 1",
                            "id": "5039614000000951853"
                        }
                    }
                ],
                "id": "5039614000000947052"
            },
            "message": "Kiosk test run started successfully",
            "status": "success"
        }
    ]
}