Worker Bot - Custom HTTP Action

Note: before trying to use Custom HTTP Action, make you sure you check if Tonkean already allow this action using a built-in Data Actions

Custom HTTP Action is an action block you can add to your workflow that the Bot will execute. It allows you to call an API with your own custom information. Very useful in cases Tonkean doesn't have a built-in integration or action with your Data source.

Adding a Custom HTTP Action

First, add a new action of type Http Web Action, you can find it by scrolling down or searching for it.

Configure the Action

Now it's time to configure the how the action will behave, you need to set up 3  things:

1. URL

Here you can configure where the action will reach-out to. Please make sure this is a valid URL and there is a server listening on to that endpoint. You can use add fields here as well, to configure the url based on the item the action is running on. In this example we are reaching out to our url with the user_id field that is on the Item. Since that field already has values in it we can see the result the in the field preview.

2. METHOD AND BODY

Next, match the request METHOD to what the endpoint is expecting. Based on this selection you may need to fill the Body.

You can use fields here too, although it may look a bit different. Click on the blue [+] button to easily select your field and it will be added to the end of the body (just copy and paste to where you need it).

Please note - if you are using JSON, this must be a valid JSON. Use the preview below it to evaluate your result.

3. Headers

In the last part, you can add custom headers according to you needs. Like "Authorization" if your API requires authentication. 
Content-Type is a required field and is set to "application/json" by default.