Building Extensions
What are extensions?
Extensions are bundles of practicable code integrations, containing commands, bots, message actions, functions, schedulers and databases combined together to suit your client or user requirements. Extensions created by you are listed under the My Extensions section. The extensions installed from Zoho Marketplace are listed under the Installed Extensions section.
How to build an extension?
Building an extension isn't as daunting as it sounds. Follow the below steps to create an extension:
- First, create the commands, bots, message actions, functions, schedulers and databases that you would like to bundle together as an extension. These components are the building blocks of your extension, refer internal tools to know more about how to create them. Once you have all the above mentioned components ready, you can create your extension.
- Click your display picture, select Bots & Tools and click on Extensions.
- Click Create Extension and give your extension a name, description, image and select the commands, bots, message actions, image and select the commands, widgets, functions, schedulers and databases. A maximum of 4 integration components such as commands, message actions, schedulers, 1 bot, 1 widget, 20 functions and 6 databases can be added together as an extension.
- Once you have selected the components to be included, select the Create button to get the first version of your extension ready. Simultaneously a sandbox version of your extension will be installed along with the extension components (internal tools).
- The sandbox version of your extension should be used for developing extension upgrades and publishing them.
- This extension will be listed under the My Extensions section. You can either Publish or Edit it further.
Here's how you can create an extension
It is not mandatory for an extension to have all the above-mentioned components. You can have an extension containing only a single component (commands, bots, message actions, functions, schedulers and databases) or bundle each component together as an extension.
Sandbox Version
A sandbox extension is just a production replica of your extension. The extensions created and listed under the My Extensions sections are the sandbox versions. This allows you to test the extension for issues before proceeding to publish in the marketplace. Once an extension is created, all the components bundled in the extension will also have a sandbox version created and listed under their respective sections. To publish an upgrade to your extension, you will have to edit the code present in the component's sandbox version.
For example, the Asana extension can have a @Asana bot and an /asana command. Upon creating the extension, sandbox versions of the @Asana bot and /asana command are created. Any changes in the bot or command's functionality will have to be made in this sandbox version of the command and bot and can be pushed live as an upgrade.
Extension Connectors
Extension connectors are basically components that play a major role in authenticating and integrating your extension with the third party service.
- App Key
The App key is a unique identifier for your extension and is mandatory for authentication. This key has to be sent as a request parameter with the param name appkey for all endpoints. Each extension is provided with two app keys, the Sandbox App key and the Marketplace App key by default. App keys are like a token for your extensions and must be used in all API endpoints. The sandbox app key can be used while testing the extension in the sandbox environment. You can also generate a new set of App keys by clicking the Generate option. A maximum of only 3 App Keys can be generated at any given point of time.
- Incoming Webhook Endpoint
The extension's incoming webhook endpoints can be used to register the extension with a third party application to receive custom callbacks. The incoming webhook endpoint should also be authenticated with the extension's app key and the zapi key. Callbacks to this endpoint can be handled in the extension's incoming webhook handler, wherein you can decide to direct the response to a channel or bot added in the extension. The extension incoming webhook endpoint syntax is given below
//Sample Extension Incoming Webhook Endpoint
https://cliq.zoho.com/api/v2/applications/{app_id}/incoming?appkey={app_key}
Extension Handlers
All extensions come with their own set of 4 handlers, thereby granting access to configure and customise even your extension's installation. The extension handlers are:
Editing an extension
Only extensions created by you can be edited.
To edit an extension, click Edit by hovering over the extension name.
- Editing an extension before publishing:
Cliq permits you to change the extension description, image and even alter the components you would like to bundle. Just unchecking a previously added component will remove it from the extension bundle.
- Editing an extension after publishing:
Once an extension is published, the extension name cannot be edited. Only the extension description, image, and the components can be edited.
Editing an extension after it is published will not make changes to the published extension in the marketplace.
Deleting an extension
Delete an extension by clicking on the extension name. The extension preview page has the 'Delete' extension button at the bottom. Note that deleting will not delete the extension from the marketplace. After deleting an extension it cannot be retrieved back and cannot be edited in the marketplace after being deleted.