Events & API Proxies
In this, you’ll setup the Events and API Proxies required for the integrations
API Proxies and Events allows your organization to integrate your services better with the workflows in Cobalt.
API Proxies help you to setup your own APIs to be used in workflows which can be used to fetch data to your system;
While you can send data from your apps to other apps by using Cobalt Events. These Events contain the payload of any object that you want to write to the third party application.
Let’s look in detail how you can setup both of these in Cobalt.
Create API Proxy
You can learn in detail about API Proxies in our guide here.
Follow these steps to create an API Proxy:
Create Action
Navigate to Developer
in Cobalt > API Proxies
> Click on the New Action
button > provide a Name
and Description
for the API Proxy > Click on the Create Action
button.
Configure the Fields
Click on the Fields
tab > Click Edit
> And add Custom fields for your action.
Configure the API Call
Click on the API Call
tab > Click Edit
> Configure the API call to be executed upon triggering the action by defining HTTP Method, Path Params etc.
These API Proxies can now be added as a node in the workflow and you can send any data that you want through it.
To learn more about how you can create a sample workflow with an API Proxy, refer to our guide here.
Create Event
An event model contains name of the event and the trigger payload. The trigger payload contains sample data schema that can be used as data variables and are used inside a workflow as placeholders while defining the workflow.
To learn more about Cobalt Events, you can refer to our guide here.
Follow these steps to create an Event in Cobalt:
Navigate to Developer
in Cobalt > Events
> Click on New Event
> Select a Model
> Update the sample Payload to your requirements > Click on Create Event
.
It is expected that you pass on the data as the Sample Payload while you are triggering this event. This is because, the properties defined in the sample payload can be used as trigger variables inside a workflow.
You can trigger an event that was created in Cobalt by using the Trigger Event API.
To learn more about how you can create a sample workflow with an Event, refer to our guide here.
Checkpoint
Congratulations!! You have created an API Proxy & Event successfully which can be used to read and write data from the workflows.