HTTP Request - Cognigy Documentation

Documentation Index

Fetch the complete documentation index at: /llms.txt

Use this file to discover all available pages before exploring further.

Description

The HTTP Request Node lets you make an HTTP request within a Flow. When triggered, the HTTP Request Node performs the request to the specified URL during Flow execution. Using the HTTP Request Node, you can manage Cognigy.AI resources by creating, updating, and deleting them via the Cognigy.AI API. You can also use external APIs, such as Google Maps for location data, OpenWeatherMap for weather updates, and NewsAPI for the latest news, or any other external API to enhance chat or voice conversations. If you use an external API, make sure the server has a public certificate to avoid connection and secure issues.

Limitations

The default timeout is 15 seconds in a shared SaaS installation and 8 seconds in dedicated SaaS or on-premises installations. You can change this limit only for the following installation types:

Parameters

HTTP Request Methods

GET

The method retrieves data from the server. The results of the GET request are stored in the context of the Flow. You can retrieve the requested data of your GET request by accessing the context with the key you defined in the HTTP Node settings.

POST, PATCH, and PUT

The methods are used for the following purposes:

The standard Content-Type header is application/x-www-form-urlencoded. To use a different Content-Type, set the header value explicitly or use JSON. For URL-encoded data, you don’t need a specific header. URL encoding replaces unsafe characters in URLs with a percent sign (%) followed by two hexadecimal digits representing the ASCII code of the character. This approach ensures the data is transmitted correctly over the web. For example, you can send the data +49555262626 and https://handler.twilio.com/twiml/EHf9b7af093c31b5baa1414be891 as a URL-encoded payload:

To=%2B49555262626&Url=https%3A%2F%2Fhandler.twilio.com%2Ftwiml%2FEHf9b7af093c31b5baa1414be891

where: Each key-value pair is separated by &, and each key is separated from its value by =:

Payload Define the payload of your POST, PATCH, or PUT request. Select one of the following payload formats:

Inspect the response on the INFO tab in the Interaction Panel.

DELETE

The method deletes a resource from the server. The DELETE request configuration prompt exposes the General Configuration fields.

URL

The URL to the targeted resource is https://api-endpoint.com/resource. Note that Cognigy.AI expects a URL to the targeted resource in its unencoded form. Decode any encoded URL to make sure the HTTP request can be executed successfully. For more information, see URL encoding (on en:WP).

Storage Options

Define the context key where you want to store the response from the executed HTTP request. This field is required and needs to have a valid value. After the HTTP request is successfully executed, you can access the response payload by executing the following CognigyScript:

{{ context.<yourContextStore> }}

Headers

The headers are information sent along with the request, such as content type or authentication tokens. Add the headers to your HTTP request. All headers are listed in one JSON object, which should have the following format:

{
  "header-name": "header value",
  "another-header-name": "another header value"
}

For example:

{
  "Content-Type": "application/json",
  "Accept": "application/json",
}

where:

Alternatively, you can click Show JSON Editor to switch between the list view and the JSON editor. You can also enable capturing the response headers along with the request body in the specified storage location.

Authentication

The supported authentication methods are:

Authentication makes use of Connections, which means that the actual authentication information can be encrypted. When a new authentication connection is created by clicking + next to the Parameters field, the New Connection window appears to request the details specific to the authentication type. If you select an authorization type other than No Auth, additional fields related to the selected authorization type are provided.

Execution & Caching

Parameter Type Description
Execute Requests Asynchronously Toggle When you enable the Execute Requests asynchronously parameter, the HTTP Request Node executes the request without waiting for a response. This means that the execution of the Flow continues without any delay.
Timeout Number The timeout for canceling the request (in milliseconds). The default value is 8000. This setting overrides the global parameter value for your Node.
Retry attempts Number The number of retry attempts in case of an error.
Cache Results Toggle When the setting is enabled, the HTTP Node caches the responses.
Cache expiry time in seconds Number The time in seconds after which the cached response expires.

Security

Allow Insecure SSL By default, Cognigy.AI rejects connecting against insecure SSL endpoints, such as URLs with no or self-signed certificates. Activating this parameter allows the Node to connect against these URLs as well.

Error Handling & Logging

Error Logging If HTTP requests return a status code greater than 299, the response is considered an error. You can select one of the following options:

Abort Flow Execution on Error When the setting is enabled, the Flow stops if the response has a status code greater than 299. Debug Mode Logging Select what information to log to Debug Mode when using the Interaction Panel:

Troubleshooting

Handling Certificate Errors

When using the HTTP Request Node with a domain that doesn’t have a public certificate, errors can occur due to a missing Intermediate Certificate. An example of such an error is UNABLE_TO_VERIFY_LEAF_SIGNATURE. If there is no trusted Certificate Authority or a complete certificate chain, the request fails. Note that you can’t add a custom Certificate Authority or certificate chain to the Cognigy.AI platform. Your options are: