What Is The API App In SureTriggers?
The API app in SureTriggers is an internal tool that allows SureTriggers to talk to any application and take action in that application. With the API app, you can connect to external apps to retrieve data and trigger actions in other applications.
For example, HubSpot is not integrated into SureTriggers when I write this article but using API documentation of HubSpot, you can connect and take actions in HubSpot.
Further in this document, you’ll read how to set up API in SureTriggers.
Benefits Of Using The API App In SureTriggers
The API app in SureTriggers provides several advantages for users who want to integrate different applications in automated workflows.
- It allows you to easily connect and communicate with external APIs without requiring extensive coding knowledge.
- You can build complex workflows that involve multiple applications, saving time and reducing errors.
- You can integrate any application in SureTriggers using the API app(if the app provides open APIs) that’s not yet natively integrated into SureTriggers.
Things To Know Before Using API
If you’re new to APIs, you should get friendly with the terms below.
Endpoint URL: An endpoint URL is the unique web address that identifies a specific API endpoint. It defines the path where the API can be accessed and what action it can perform. The API documentation of the app that you want to connect with SureTriggers will specify the endpoint of the URL.
This URL is like the address of a building that tells the SureTriggers where to go.
Method: The method specifies the type of request that a client sends to an API endpoint. Common methods include GET, POST, PUT, and DELETE. Each method is used to retrieve, create, update, or delete data from any application. This too is specified in the API documentation.
Payload Type: The payload type is the format of the data that is sent in the request or response body. The payload type can be JSON, XML, or another format. The payload type is specified in the Content-Type header.
Authentication: Authentication is the process of verifying the identity of a user or application that is accessing an API endpoint. This is done to ensure that SureTriggerrs can access the API of the application and take actions or fetch information. Authentication methods include API keys, bearer token, OAuth tokens, or username/password authentication.
Headers: Headers are like additional notes or instructions that you can send with your request. They can contain important information like your API key or the format of the data you’re sending.
They usually contain information about the payload type, authentication, caching, and more. Headers are key-value pairs and are sent as part of the HTTP protocol. You can add additional headers if required.
Parameters: Finally, parameters are key-value pairs that contain information that you may want for the application that you want to connect. This is usually required while using POST or PUT method where you’re taking actions like creating and updating stuff.
For example: While creating items in infinity via SureTriggers API, the params may be customer_name, email, etc. The keys for these parameters are mentioned in the API documentation.
How To Configure The API App In SureTriggers
To use your API connection in a workflow, add an “API” action to your workflow.
In the “Action” menu, select the “API” app from the list of available apps.
In the API action configuration, enter the following details as per the instructions of the API documentation of the app that you want to connect with:
- Method: Select the appropriate method for your API call (GET, POST, PUT, PATCH, or DELETE).
- Enter the endpoint URL for the API call you want to make.
- Payload: Select the payload type as suggested in the API documentation.
- Headers: Enter any headers required for your API calls, such as authentication information or content type.
- Parameters: You can map dynamic data from a trigger or previous steps in the automation as the values to parameters and pass it to the server.
Once you’ve mapped all the fields as per the requirements, you can perform test action to ensure that every piece of information is correct.
Once tested, you can save this API step, complete the workflow configuration as usual and publish the workflow!
That’s all. The API call would be made whenever the trigger runs to complete the intended action.
Do you also know that, in SureTriggers, you can save a configured API step with all its data and use it in your same account in any other step, without having to configure the step from scratch?
See here how to save and reuse API endpoints across different workflows.