# Configuring A Base URL For An HTTP Connector

To restrict outbound requests to a specified URL, you can configure a base URL for your HTTP connection. This ensures that anyone using the connection in recipes can only connect to the server or application you specify.


# Ensuring Security Over The HTTP connector

Data governance is of upmost importance. This includes when data is flowing from one app to another. Setting the base URL ensures that your sensitive data will only pass through a specific endpoint, domain, or host.

# Use The Correct API Version

Ensure that all requests are made to the correct API version of the target application. Once the base URL is configured, all requests are routed to the same endpoint, including the API version.

Configuring the base URL simplifies recipe updates as API versions change. By configuring a base URL, you can quickly update request URLs for all recipes without needing to manually update individual actions.

For example, you can configure the base URL to a specific version of Salesforce REST API. When it is time to update the API version, you simply have to update the base URL of the HTTP connection:

https://instance.salesforce.com/services/data/v53.0

# How It Works

When an HTTP action executes an action, the Base URL and the action's Request URL are used to construct the final request URL. Think of it this way: Base URL + Action Request URL = Final request URL

For example:

  • Base URL: https://instance.salesforce.com
  • Action Request URL: /services/data
  • Final request URL: https://instance.salesforce.com/services/data

Workato will restrict all outgoing HTTP requests to the base URL provided. The URL validation rules are:

HTTP request Description
Absolute path Base URL: https://instance.salesforce.com
Request URL: https://instance.salesforce.com/services/data/

Workato will validate that the base URL of the given endpoint matches the base URL of the connection.
Relative path with / prefix Base URL: https://instance.salesforce.com/services
Request URL: /services/data/

Workato validates that path starting from the root-level domain (.com). In this example, /services in the base URL matches with /services in the request URL.

Note: Relative paths can only be used if a Base URL is configured.
Relative path without / prefix Base URL: https://instance.salesforce.com/services
Request URL: data/

Workato appends the request URL to the base URL.

Note: Relative paths can only be used if a Base URL is configured.

# Base URL Errors

If the action request URL attempts to use a different base URL or if the computed final request URL is not valid, Workato will prevent the HTTP action and stop the job with an error.

Here are some common errors with HTTP base URL validation:

Type of Error Example
Using a different base URL Base URL: https://instance.salesforce.com
Request URL: https://acme.com/users/

The base URL does not match.

Error message:
Attempted to send request to https://acme.com/users/ but only request with base URL https://instance.salesforce.com is allowed.
Mismatch relative path with / prefix Base URL: https://instance.salesforce.com/services
Request URL: /rest

The relative path does not match /services defined in the Base URL.

Error message:
Attempted to send request to https://instance.salesforce.com/rest but only request with base URL https://instance.salesforce.com/services is allowed.

# Defining The Base URL

In the HTTP connection setup, complete the Base URL field. The base url is typically provided by your target API's documentation.

For example, the base URL for the Salesforce REST API (opens new window) is:

https://instance.salesforce.com/

This applies for both cloud-based HTTP endpoints and on-premise HTTP endpoints.


Last updated: 7/10/2024, 6:18:20 PM