Creating a trigger
As triggers only watch for new data and typically need to send no or little data to the app. Triggers are how your app’s users can start automated workflows whenever they add or update something in your app. To make a standard trigger, use an API endpoint that lists new items in an array sorted in reverse chronological order.
Triggers are two types:
Rest Hook
Pooling
Before You Start:
You should have a configured app and trigger resources(means why you need trigger eg: for inventory updates, status updates, etc).
How it works
From your Partner Dashboard
Go to App. All your created apps will be visible on this page.
Select a created app.
You will be redirected to the App detail page.
Click on the Extension page.
Click on the Trigger tab and click Add Trigger. Trigger page consists up of 3 sections, which the user has to fill.
Core detail section:
Key: A unique identifier for this trigger
Name: A human-friendly plain text name for this trigger
Noun: A single noun that describes what this trigger
Description: A plain text sentence that describes what your action does to help users understand why they should use this trigger
Visibility Options: An option to select when this trigger will be shown.
Important: shows the trigger by default which in App’s action list.
None: Choose None if you want this trigger hidden by default.
Hidden: choose Hidden if this action should not be shown to users.
Click on Save and continue.
Input Designer section will open to build the input form field. Add all the required fields in input designers as per your need.
Click on Save and continue.
API configuration section: This consists up of three parts, where you have to enter the required details for setting up your trigger. To configure the Trigger fill the below fields.
Configure your API Request:
Trigger Type : Trigger can be of 2 types: polling or rest hook. You can select anyone as per your needs. If you select:
Polling: You have to enter the below-mentioned API details:
API Endpoint: Enter the URL Your APP will poll for new items. i.e: Pooling API URL with required headers. (This request must return an array.) NOTE: You can turn your form mode to code mode. if needed, click the Switch to Code Mode to write a custom API call in JavaScript code.
Pagination: select whether it supports pagination or not.
RestHook: You have to enter the below-mentioned API details:
Subscribe: Enter the endpoint URL to create a new webhook subscription.i.e: configure the POST API with required headers and BODY. that will register a webhook in our system. on which we can send the updates. NOTE: You can turn your form mode to code mode. if needed, click the Switch to Code Mode to write a custom API call in JavaScript code.
Unsubscribe: Enter the endpoint URL to remove a webhook subscription. NOTE: You can turn your form mode to code mode. if needed, click the Switch to Code Mode to write a custom API call in JavaScript code.
Perform List: Enter the endpoint URL So Your APP should check for recent items, to provide sample data in the Zap Editor. This request must return an array. NOTE: You can turn your form mode to code mode. if needed, click the Switch to Code Mode to write a custom API call in JavaScript code.
Click on Save API request and continue.
Test your API Request: In this step, you can connect to your app using the above settings with a personal or testing auth account, and APP will use this connection to test API calls as you build the integration.
Select a Request: select an API from above configure API, which you need to test.
Test your Authentication Configuration: select your auth account for testing.
Click on test your request button.
click finish testing and continue.
Define your Output: Steps to define sample output data.
Sample Data: Enter JSON-formatted sample output data for the most commonly used fields from this Trigger to use in APP as sample data if users don’t test it.
Click on Generate output field definitions.
Output Fields: On click Generate output field definitions. A table gets created with key-value pairs as mentioned in the sample data. (NOTE* You can Add user-friendly names for the most popular fields from API output data).
Click on Save and continue.
Last updated
Was this helpful?