# Building a HTTP action

After you have setup your HTTP connection, you can now configure HTTP actions.

# Action configuration

The configuration for both actions are the same and you can follow the documentation below to configure free-form requests to any API.

To start, give your request a name to identify it. This also changes the Workato action name at the recipe-level.

Provide request name Provide request name

You may choose to use the HTTP wizard by clicking Start guided setup or choose to configure the action manually with the following inputs.

# Input

Input field Description
Request name Allows you to provide a human readable description of what this API request does.
Request Contains all information related to the request - Verb, Request URL, Request payload and headers.
Response Contains all information related to the response - Response type, encoding and headers.

# Output

The output of this HTTP action depends on the response body schema defined in your HTTP configuration.

# Workato HTTP wizard

Workato has a 3-step HTTP wizard that prompts you to make a test request to the API endpoint. This wizard will try to provide a recommended HTTP configuration for your endpoint wherever possible.

Click Start guided setup to begin.

You may exit this setup wizard at any point if you wish to configure the action manually.

# Example HTTP action

We will be going through an example of building a HTTP action using the Workato HTTP wizard - Create venue in Eventbrite.

# Step 1: Provide HTTP method and request URL

To begin, provide the absolute API endpoint you wish to call, and the HTTP method of that endpoint. These should be available via the app's API documentation.

Step 1: Provide HTTP method and request URL Step 1: Provide HTTP method and request URL

In this example, we wish to view existing incident records from Service now. When referring to the ServiceNow documentation (opens new window), we see that this API is a GET call with an endpoint of https://<instance>.service-now.com/api/now/v1/table/incident. We'll fill out the fields as follows.

Configuring HTTP method and request URL Configuring HTTP method and request URL

# Step 2: Configure and send sample request

Here, you configure the sample request to send to the API endpoint. For some endpoints, Workato recommends a sample request to send, which you can either choose to customize further or remove entirely to build it from scratch.

You can configure the sample request using the following methods:

  1. Accept Workato's recommended request settings,
  2. Accept Workato's recommended request settings and customize further, or
  3. Remove Workato's recommended request settings and build the request from scratch.

TIP

When using AWS authentication methods - Access key or IAM role auth, you don't need to append any additional authentication parameters. In AWS Documentation, these are often denoted as AUTHPARAMS.

In our example, Workato recommends a sample request body for the ServiceNow endpoint, which we'll accept.

Step 2: RecipeIQ recommendations for HTTP configuration Step 2: RecipeIQ recommendations for HTTP configuration

In addition, we will add in the field sysparm_limit and set the value to 1. This will limit the number of records to retrieve from ServiceNow.

Step 2: Adding request parameter Step 2: Adding request parameter

If you chose to remove RecipeIQ recommendations, you can build your sample request from the following screen.

Step 2: Configure and send sample request Step 2: Configure and send sample request

You can copy and paste sample request JSON from the API docs to create your sample request body and add required headers.

# Step 3: Review HTTP configuration

With a successful request, we know that:

  • the connection has been set up successfully,
  • the API endpoint we're sending our request to is correct, and
  • we're sending the right set of request body fields for example, all required fields with valid values

https://v1.vuepress.vuejs.org/guide/markdown-slot.html#example Request successful

We can choose to customize our request further by going back to Step 2 to configure our request and sending another sample request. When we're happy with the configuration, click Apply configuration. The request and response will be saved to the Workato HTTP action, and the HTTP wizard returns you to the recipe page.

Configuration applied for HTTP action Configuration applied for HTTP action

# Final HTTP configuration

We know that this configuration works - now it's time to replace the static values with datapills that hold dynamic values.

This is what the HTTP configuration should look like after I've put in my relevant datapills. This HTTP action is now ready to be used!

Completed HTTP action Completed HTTP action

# Configure HTTP action as a long action

TIP

"Wait for response" in HTTP action is a beta release available to everyone using Workato's HTTP connector.

At this point, you may also choose to make this HTTP action a long action, if you know that the endpoint will take more than a few seconds to respond. This can be done by setting the field "Wait for response" to "Yes".

The key difference with and without the "Wait for response" enabled can be found in the table below.

Without "wait for response" With "wait for response"
Request timeout Up to 120 seconds Up to 1 hour
Response size Soft response size limit of up to 200MB Hard response size limit of 100MB
Connection types All HTTP connection types are possible Connections that use custom SSL certificates or OPA are not supported
Job processing Jobs in the queue will be processed in order Jobs may not be processed in order

In most cases, we recommend starting without "waiting for response" when building. If timeouts do occur, enabling "wait for response" can be done easily within the same action after building your initial recipe.

# HTTP setup documentation

You can also browse the other chapters:


Last updated: 4/18/2024, 5:51:20 AM