Generate Sample Payload to Test Integration Functions

Payload Generation

Integration functions enable you to code and use a Catalyst function as the backend of other Zoho services, and establish an integration with them. Catalyst currently supports integration with Zoho Cliq and ConvoKraft Bot Logic through Integration functions.

You can develop the backend of Cliq extensions that bundle bots, commands, message actions, widgets, and functions through Integration functions. The CLI enables you to generate sample payloads for various handlers in each of these tools.

Note: Integration Functions is currently not available to Catalyst users accessing from the EU, AU, IN, or CA data centers.

The general command to generate a sample payload to test an Integration function in the CLI is:

copy
$
catalyst event:generate:integ [options] <service>

Because Catalyst only supports integrations with Cliq currently, you must provide the following value for as the service: ZohoCliq.


Catalyst supports the following Cliq components and handler classes that you can generate a sample payload for, in the CLI.

Component Handler Classes
bot welcome_handler
message_handler
context_handler
mention_handler
action_handler
incomingwebhook_handler
participation_handler
command execution_handler
suggestion_handler
messageaction execution_handler
widget view_handler
function button_handler
form_handler
form_change_handler
form_values_handler
widget_button_handler
installation installation_handler installation_validator

  1. Execute the following command to select the component and a handler class to generate the payload for:
copy
$
catalyst event:generate:integ ZohoCliq

  1. Select a component from the list and press Enter .
    Integration Functions Payload Generation

  1. Select a handler class from the list and press Enter .
    Integration Functions Payload Generation

The CLI will generate a sample JSON payload for that component and handler source. Depending on the component, the payload will contain relevant data.

Integration Functions Payload Generation

You can also directly save the JSON payload into a file instead of displaying it in the CLI.


Integration Functions Event Generation Options


--inputs <inputs>

You can generate a sample payload to test Integration functions by directly specifying the component and the handler you require the data for. The inputs must be specified in the following format:

copy
$
catalyst event:generate:integ ZohoCliq --inputs component,handler

For example, to generate a sample payload for a form_handler class for the function component, execute the following command:

copy
$
catalyst event:generate:integ ZohoCliq --inputs function,form_handler

This will generate the following JSON payload.

Integration Functions Payload Generation

Refer to the table shown above for a list of Cliq components and handler classes supported by Catalyst.

Note: If you are a Visual Studio Code IDE user, you can install the Catalyst Tools extension, and perform CLI operations using your IDE in place of the CLI. Steps to debug your event functions using Visual Studio Code IDE can be found here.

Last Updated 2024-01-09 17:07:13 +0530 +0530