How are triggers created?
Let us suppose, you want to create a trigger “To-do created” in your app “Basecamp”. Click the Triggers tab from the app menu. This page will display all existing triggers in your app as shown below. To create a new one, click the Create Trigger button. A form will appear that will take the trigger metadata as input.
To create a trigger the following information has to be provided.
Trigger Basic info and Endpoint
Starting with basic information, trigger name and description. Next, you need to add the endpoint. Trigger endpoints can be created in two ways. If your app supports webhooks, then the endpoint is a URL where Integry will receive Webhooks from your app when the trigger occurs (To-do created in this case). If your app does not support webhooks, then Integry will poll to check the status of the event. Polling and webhooks endpoints are created differently. Check: How to add webhook based trigger endpoint and How to add polling based trigger endpoint for details.
Once the endpoint is added, next you need to select the Authorization method of your trigger. This comes in handy if your app supports multiple authorization types. In most of the cases, the trigger authorization type is the same as the app authorization type. In this case, you will select the authorization name from the drop-down menu. If not, select Create new Authorization from the menu. Read, How to create an authorization endpoint.
Activity Fields are where you define what data will be collected when a user creates an integration to specify how the trigger will be created. Taking the running example of Basecamp, “To-do Created” (supposing your app is Basecamp for the scope of this example). When a user creates an integration using this trigger, they need to provide Basecamp account details. These details are collected through activity fields. We know from Basecamp API Docs the following URL creates a To-do:
POST /buckets/1/todolists/3/todos.json creates a to-do in the project with ID 1 and under the to-do list with an ID of 3. Furthermore, we also know that the base part of this URL is https://3.basecampapi.com/5 where 5 is the Account ID.
The Account, Project and To-do list IDs will be collected through activity fields. The user will provide this information at the time of integration creation. Once the details are provided the user account is linked to this event (to-do created). Whenever a To-do is created in this account Integry is notified. We have a detailed guide written for you to configure your activity fields.
Hooks are the endpoints that are executed when a user saves, deletes or updates an integration that uses the trigger. The hooks associated are configured while setting up the trigger. To learn about these and how to add them to your action or trigger, click here.
Saving a Trigger
When you proceed to save the trigger, you can view three buttons at the end of the page as shown below.
Cancel: Cancels the trigger all together
Create Trigger: Saves a trigger as a draft. You can edit it later if required and test it as well. The other apps cannot view the trigger while creating templates unless it is published.
Submit for Approval: When you submit a trigger for approval, it is sent to our team for review. Once all looks good and is tested properly, the trigger is published. It becomes available to other apps as well.
Once the trigger goes live you cannot edit it completely. Lear more.
You can cancel the request for approval as well to make changes to the trigger. As soon as you submit the request, you can view a Cancel Review and Edit Trigger button as shown below.
We hope you now know about triggers and how they are created.