The Call an API action sends an HTTP POST request to an external service, with or without authentication.
Use it to pass data from TimeTonic to an external automation tool, a database or a notification service.
Prerequisites: the webhook URL of the external service and the POST method. A token or credentials if the call is secured (Bearer token or Basic). The table fields that supply the values to send.
It sends an HTTP request to an external service as soon as your automation scenario reaches the action. These are the most common use cases.
Trigger an external scenario
A created or modified row starts a scenario in an external automation tool.
Create a row elsewhere
The call creates a row in another workspace or another tool.
Pass on a validated lead
The information goes to a sales-management database.
Update an external database
The data entered in TimeTonic feeds an external database.
Send a notification
A message or an alert goes to an end user.
2. How do I add the action to an automation?
Open the automation of your table, insert your trigger and conditions, then add the action.
1
Add the action
Click the action + button.
2
Select Call an API
Choose Call an API in the list of actions.
3. What does the configuration window contain?
The Call an API window has three areas: the URL, the authentication and the content sent.
1. Insert the URL
Paste the webhook URL provided by the external tool.
2. Authentication
Choose No authentication, Bearer token or Basic authentication.
3. Webhook payload
Define the properties and values to send.
4. How do I choose the call authentication?
Without authentication, the call is not secured. With a Bearer token or a name and password pair, the external service checks the call before accepting it. The values you enter in TimeTonic must match the external tool.
4.1 No authentication
Use no authentication method: the call is not secured.
In TimeTonic
Value
Method
POST
URL
Paste the webhook URL of the external tool.
In the external tool
Value
Method
POST
API URL
The URL of the webhook you created
Authentication
None
This video shows a call to an external automation tool with no authentication.
4.2 Bearer token
Create an access token to protect the call. You enter the same token in TimeTonic and in the external tool.
In TimeTonic
Value
Method
POST
URL
Paste the webhook URL of the external tool.
Authentication
Select Use Bearer token
Enter an access token
[set an access token]
In the external tool
Value
Method
POST
API URL
The URL of the webhook you created
Authentication
Select Bearer Auth
Header name
Authorization
Expected header value
Bearer 123456 Replace 123456 with the token set in TimeTonic.
This video shows the Bearer mode that secures the HTTP call.
4.3 Basic authentication
Secure the call with a username and password pair. Both values are identical in TimeTonic and in the external tool.
In TimeTonic
Value
Method
POST
API URL
Paste the webhook URL of the external tool.
Authentication
Select Basic authentication
Name
[set the name]
Password
[set the password]
In the external tool
Value
Method
POST
API URL
The URL of the webhook you created
Authentication
Select Basic Auth
Name
[same as in TimeTonic]
Password
[same as in TimeTonic]
This video shows the connection to the API with a login and a password.
5. How do I define the data to send?
In the last part of the window, you choose the data passed to the API. Each added line is one key / value pair.
Element
Description
Property name
The name of the JSON property the API expects. Example: test call.
Value
A fixed value, such as "Foo" or "OK", or a dynamic variable, such as $FieldInput. A variable sends the value of a field of the TimeTonic row: description, name, date.
Example: you send the value of the Description field of a row in a JSON property named test call. You enter this:
TimeTonic then generates the following JSON:
{
"test call": Content of the "Description" field of the TimeTonic row
}
Add a line with the + button if the API expects several fields.
6. How do I validate and test the call?
1
Validate
Click Validate, then activate the automation.
2
Test
Modify or create a row to trigger the API call.
3
Check
Confirm in the external tool that the API call was received.