The Inject Transformer converts the webhook payload from an external service before you call an Inject API request, which sends the data to the Flow. With the inject transformer, you donโt need a service that translates the webhook payload of the external service into the correct format for the Inject API request. You can handle this conversion in the inject transformer by parsing the payload to return only the necessary values. You can configure the inject transformer in theDocumentation Index
Fetch the complete documentation index at: https://docs.cognigy.com/llms.txt
Use this file to discover all available pages before exploring further.
handleInject function in the Endpoint settings or via CLI.
Restrictions
- The inject transformer is supported only for webhook- and socket-based Endpoints.
-
The return value is validated against a set of rules. If these rules arenโt met, the transformer throws an error. The following rules apply:
userIdis a string with up to 256 characters.sessionIdis a string with up to 256 characters.textis a string with up to 10,000 characters.datais an object.
Transformer Function Arguments
The following table shows an overview of the function arguments:| Argument | Description |
|---|---|
| endpoint | The configuration object for the Endpoint. |
| request | The Express request object with a JSON-parsed body. |
| response | The Express response object. |
Endpoint Configuration Object
endpoint Object Properties
endpoint Object Properties
| Property | Type | Description |
|---|---|---|
_id | string | The Endpointโs Reference ID. |
channel | string | The Endpointโs channel. |
URLToken | string | The URL Token, found in the Input object. |
name | string | The Endpointโs name. |
flowId | string | The Reference ID of the specified Flow to which the Endpoint points to. |
entrypoint | string | The Entrypoint of the Endpoint. |
active | boolean | The flag to activate or deactivate the Endpoint. |
nluConnectorId | string | ID of the selected NLU connector for the Endpoint. |
useAnalytics | boolean | The flag to collect analytics data for the Endpoint. |
storeDataPayload | boolean | The flag to store data payloads into analytics for the Endpoint. |
useConversations | boolean | The flag to collect conversations history for the Endpoint. |
maskIPAddress | boolean | The flag to mask sensitive IP addresses in input object and analytics data. |
maskAnalytics | boolean | The flag to mask sensitive data in analytics for the Endpoint. |
maskLogging | boolean | The flag to mask sensitive data in logs for the Endpoint. |
useContactProfiles | boolean | The flag to use Contact Profiles for the Endpoint. |
useDashbotAnalytics | boolean | The flag to use Dashbot for collecting analytics data. |
dashbotApikey | string | The API key of the Dashbot bot for analytics collection. |
dashbotPlatform | string | The selected platform of the Dashbot bot for analytics collection. |
settings | object | Optional Endpoint-specific settings. For example, Facebook Page token. |
handoverSettings | object | Settings to configure a handover provider. |
createdAt | number | Unix timestamp when the Endpoint was created. |
lastChanged | number | Unix timestamp when the Endpoint was last modified. |
createdBy | string | Email of the user who created the Endpoint. |
lastChangedBy | string | Email of the user who last modified the Endpoint. |