What are triggers in marketplace app and how to add triggers?

What are triggers in marketplace app and how to add triggers?

This article covers the steps to take for adding triggers in marketplace application. 
What are triggers? Triggers in marketplace apps enables the app developers to trigger Kylas workflows based on an event that takes place in their application. And this trigger enables the end user to perform a desired action via the workflow. Below are some example user cases that can be fulfilled via the marketplace app triggers: 
  1. Send a WhatsApp message from Kylas WB messaging app via workflow when the payment is done by the payment link generated by Razorpay.
  2. Send an Email to the customer when KYC requests is generated from SETU.
This way user can connect two or more marketplace apps via Kylas workflows using app triggers and actions. 

Prerequisites: 

Product plan: Kylas elevate and above
Permissions: Tenant user who can create marketplace app as covered in https://support.kylas.io/portal/en/kb/articles/how-to-create-a-marketplace-application 

Steps: 

  1. Create or edit a marketplace app and reach up to step 5 as covered in https://support.kylas.io/portal/en/kb/articles/how-to-create-a-marketplace-application 
  2. Choose yes if you want to specify app triggers on the below screen 
  3. Choose the entity type for which you would like to add the trigger and enter the Trigger Name
  4. Define the variables that you would send on the webhook URL (generated in next step) along with this trigger.

  5. You can define as many variables as you want, the end user of your application will be able to use the values of these variables as Workflow conditions, Template variables and much more. 
  6. Click Next to move to the next step 
  7. You will see the App trigger URLs along with a sample curl request that you are supposed to pass when the trigger event occurs as shown below 

  8. You can click the 'View sample request' to view a sample curl that you can try hitting 

  9. Look at the format for the variable types you have added carefully in the sample request, and make sure to send the data in similar format to let Kylas workflows function correctly. It's mandatory to send 
  10. You may add multiple such triggers for corresponding events.
  11. Whenever the desired event occurs in your marketplace app, you need to hit the given URL with corresponding authentication and body and if Kylas user has added this trigger as their workflow trigger as explained in https://support.kylas.io/portal/en/kb/articles/how-to-let-a-marketplace-app-event-trigger-kylas-workflow then the workflow will trigger and it will perform the added actions. 
Sample curl requests with Authentication as Token:

curl --location 'https://api-qa.sling-dev.com/v1/workflows/triggers/lead/a0a30acc-f9cb-49e0-a6e8-91280ad5249b' \
--header 'Authorization: Bearer <Your bearer token>' \
--header 'Content-Type: application/json' \
--data '{
        "mpEntityId": 1234,
        "mpEntityName": "Some Text",
        "mpConnectedAccountName": "Some Text",
        "mpPanNumber": "Some Text",
        "mpKycRequestId": "Some Text",
        "mpKycRequestStatus": "Some Text",
        "mpKycResponseMessage": "Some Text",
        "mpKycInitiatedAt": "2021-09-07T05:15:35Z",
        "mpKycCompletedAt": "2021-09-07T05:15:35Z",
        "mpRequestCreatedByUserId": 1234,
        "mpRequestCreatedByUserName": "Some Text",
        "mpCustomerName": "Some Text"
    }' 


Sample curl request with API key as authentication: 

curl --location 'https://api-qa.sling-dev.com/v1/workflows/triggers/lead/a0a30acc-f9cb-49e0-a6e8-91280ad5249b' \
--header 'api-key: <Your Tenant's API key>' \
--header 'Content-Type: application/json' \
--data '{
        "mpEntityId": 1234,
        "mpEntityName": "Some Text",
        "mpConnectedAccountName": "Some Text",
        "mpPanNumber": "Some Text",
        "mpKycRequestId": "Some Text",
        "mpKycRequestStatus": "Some Text",
        "mpKycResponseMessage": "Some Text",
        "mpKycInitiatedAt": "2021-09-07T05:15:35Z",
        "mpKycCompletedAt": "2021-09-07T05:15:35Z",
        "mpRequestCreatedByUserId": 1234,
        "mpRequestCreatedByUserName": "Some Text",
        "mpCustomerName": "Some Text"
    }'
Note:: As best practice you should ask you users to which triggers out of all available ones they want to enable in the app and you should only send event to Kylas URLs for the subscribed triggers to avoid hitting rate limiting.


    • Related Articles

    • How to add marketplace app trigger as a trigger event for Kylas workflow?

      This article covers the steps to perform in order to add a marketplace app trigger as the workflow trigger event. This will enable you to let a workflow get triggered by an external event taking place in a marketplace app and you can use this for ...
    • How to Create a Marketplace Application?

      Step 1: Go to Kylas Marketplace apps >> Manage Apps >>Create App · After Clicking on Create app, you will be asked to enter the required information o App Type :- you can either publish this app for private use or make it public o App Category: - ...
    • How to uninstall a marketplace application?

      This article covers the steps to be followed for uninstalling marketplace applications with a KYLAS CRM account.  Prerequisites Permissions: Any user who has a marketplace app installed Product Plans: Elevate, Explore Activities to be ...
    • How to Install SMS application?

      This article covers the steps to be followed and the pre-requisites for installing SMS App. How to Install SMS App Prerequisites Permissions: Any user having access to Kylas marketplace. Product Plans: Elevate. Step 1: Login to kylas using your ...
    • How to set-up your Zoho Books with Kylas

      This article will cover steps to integrate Zoho Books with Kylas. This app helps users to connect their invoicing application and create invoices directly from CRM itself without switching the apps. Kylas users can connect to this invoicing tools to ...