Marketplace supports callbacks for extension's events. Developer can subscribe to the supported events and when the extension event is triggered, callbacks are invoked.
Supported Platform Event Callback's are,
- onInstall
- onZohoAuthorise
- onTPAAuthorise
- onTPARevoke
- onUpdate
- onConfigParamAdd
- onConfigParamDelete
- onUninstall
Sample plugin-manifest.json
Subscribing to the Events
Extension manifest's callbackListener property is used for declaring the callbacks for the extension's events. To subscribe to an event, specify the callback URL in the manifest for the callbackListener's respective event.
Event Callback Request
Whenever the extension event occurs, the callback URL is triggered with security parameters which can be used to call the authenticated APIs.
Sample Event Callback Request
URL : manifest.callbackListener.{eventName}
RequestMethod : POST
RequestHeaders : HASH
Content-Type : application/json
RequestBody : JSONObject in #EVENT_CALLBACK_PAYLOAD_FORMAT format.
EVENT_CALLBACK_URL
https://zohodeskapp.com/authorized.php
EVENT_CALLBACK_HEADERS
EVENT_CALLBACK_PAYLOAD_FORMAT
- {
- "event" : "onZohoAuthorise",
- "orgId" : 387238,
- "securityContext" : "2398deio3qwnx3c9xwi3nc3njkh9jfico"
- }
#EVENT_CALLBACK_PAYLOAD_FORMAT
Events
onInstall
onInstall will be triggered when the customer installs an extension. The developer can subscribe to the event with the URL and perform his logic.
Example Usage
Creating a Third party resource once the customer installs the extension.
onZohoAuthorise
Once the end user installs the extension, he needs to authorize the desk & TPA (say jira). onZohoAuthorise will be triggered when the customer authorize the DESK. The developer can subscribe to the event with the URL and perform his logic.
Example Usecase
Creating a Zoho Desk webhook once the desk authorization is completed.
onTPAAuthorise
The event will be triggered once the user authorize the Third party app.
Example Usecase
Subscribing or creating a webhook in third party service.
onTPARevoke
The event will be triggered once the user revoke the Third party app authorization.
Example Usecase
Revoking or deleting the added webhooks in the third party services.
onUpdate
The event will be triggered when the user upgrade the extension.
Example Usecase
Adding or Updating config params.
onConfigParamAdd
The event will be triggered when the customer adds configuration params in the extension.
Example Usecase
In jira extension, when customer adds configuration params such as domain, jiraAuthKey , developer shall create a jira webhook against the jira account.
onConfigParamDelete
The event will be triggered when the customer adds configuration params in the extension.
Example Usecase
In jira extension, when customer deletes configuration params such as domain, jiraAuthKey , developer shall delete jira webhook in the jira account.
onUninstall
The event is triggered when customer uninstall the extension.
Example Usecase
Operations to be performed during un-installation such as deleting webhooks.