Skip to main content
How to send HTTP requests in automation
Updated this week

Within Clustdoc, you can create automations to send HTTP requests to a specified URL whenever a trigger occurs.

Hypertext Transfer Protocol (HTTP) allows you to initiate communication and create highly customizable integrations with both internal and external domains. For example, you could have a message posted in your CRM each time an application is approved.

1. Setup your action

In the automation builder, select your trigger and choose the action " Send HTTP request"

2. Action settings

Here are the settings for HTTP request automations:

  • URL - the the http/https address that the request should target when the trigger is executed.

  • Method - specify the relevant request type:
    GET - request data from a specified resource.
    POST - send data to a server to create/update a resource.
    PUT - send data to a server to create/update a resource.
    PATCH - apply partial modifications to a resource.
    DELETE - deletes the specified resource.

  • Headers - headers to be sent in the HTTP request. Enter one header per line in the following format : header_name=header_value (Ex: Accept=application/json)

  • Body - specify the contents to be sent with the HTTP request. Can be fully customized request body formatted as JSON. Payloads are only available with POST/PUT/PATCH requests.

  • Body content - specify the Content-Type of the request .
    Fully customized request body formatted as JSON.
    Note: Payloads are only available with POST/PUT/PATCH requests.
    Field mapping - select one or multiple supported field variables to be inserted into the Payload contents, allowing you to map specific data from Teamwork.

  • Identifier - will be used in merged field to access the result of the request (see section 4 below)

3. Include merged fields in your request

Please, note that the following fields can contain Merged fields : URL, Headers, Body.

Eg: URL could be https://get-profile-by-email?email={CONTACT_EMAIL}

Read the following article to see which merged fields are available.

4. Extract information from HTTP result and use it in your application

Only for JSON formatted responses.

In order to reference the result of an HTTP request, you need to add an identifier as indicated below and use the appropriate merged field in your content :

If your request result is a JSON string, you'll be able to extract any information using this syntax. If you're familiar with programming, note that we use javascript syntax (first index of array is 1 instead of 0).

  • You access an array element by referring to the index number: array[index]

  • You can access an object attribute like this : object.attribute

Ex : Let's imagine that the text below is the result of an HTTP request automation with employees as identifier

[
{"firstName":"John", "lastName":"Doe", "colors":["orange","blue"]},
{"firstName":"Anna", "lastName":"Smith", "colors":["red"]},
{"firstName":"Peter","lastName": "Jones", "colors":["green","yellow"]}
]

Here are some examples of merged fields results :

{HTTP_ACTION_employees[1].firstName}

John

{HTTP_ACTION_employees[2].lastName}

Smith

{HTTP_ACTION_employees[3].colors[2]}

yellow

Did this answer your question?