Implementation
Set up a static or external response for your data request in your NLX workspace
Last updated
Set up a static or external response for your data request in your NLX workspace
Last updated
A Data request's Implementation is where you'll set up a static response or external integration for your Data request. When a user arrives at a in a flow, it triggers the static response or HTTP method for engaging with your data.
External mode is used when data is hosted externally and can be reached through API:
Set the implementation toggle to External
Select the appropriate HTTP method from the Method dropdown
Expand endpoint section > Enter the URL
Use NLX's AWS CloudFormation template provided within the Instructions section
Click Save
Optional:
Headers: expand section > Click + Add header > Enter the Name and static Value to be sent with the request. Useful for custom headers such as an API key, content type, content length, etc.
Development endpoint: For situations where multiple URLs are used by the environment
Now that your implementation setup is complete, you may move on to configuring your request and/or response models.
Static mode is used in cases where the response is unchanging, which may be particularly useful for building demos or for early testing. Switch the implementation's toggle to Static to begin:
Enter the data array or objects in JSON structure
Click Save
Now that your implementation setup is complete, you may move on to configuring your request and/or response models.
Data requests can be configured with two different endpoints to allow for better flexibility and control during testing and development of your applications. Either setup allows you to change the URL, URL parameters, and Headers for each:
To swap from Production to Development environment while testing in your NLX workspace, select the settings gear from your Test widget and choose Development in the Environment dropdown:
HTTP payloads that are delivered to your Data request's configured URL endpoint contain several headers, including:
Content-Type
application/json
The only content type currently supported is JSON
nlx-webhook-version
v3
The version associated with the data request configuration
x-nlx-botId
<uuid>
A unique identifier of an application
x-nlx-channelId
<uuid>
A unique identifier of the channel associated with an application
x-nlx-channelType
string
A human friendly label indicating the channel type in use such as API
, AmazonChime
or Genesys
x-nlx-conversationId
<uuid>
A unique identifier of the conversation that triggered this data request
x-nlx-correlationId
<uuid>
A unique identifier that can be used for debugging
x-nlx-deploymentKey
<uuid>
A unique identifier of the deployment associated with the application
x-nlx-intentId
string
The intent ID from where the data request has triggered
x-nlx-languageCode
string
x-nlx-userId
string
A user identifier such as a E.164 format phone number, UUID or other formats depending on the channel type.
nlx_context
object
nlx_context.botId
string
A unique identifier of the application
nlx_context.channelType
string
A human friendly label indicating the channel type in use such as API
, AmazonChime
or Genesys
nlx_context.channelId
string
A unique identifier of the channel associated with the application
nlx_context.conversationId
string
A unique identifier of the conversation that triggered this data request
nlx_context.languageCode
string
nlx_context.<attributeName>
string, number or boolean
A set value of a custom context attribute. The attribute name can be an alphanumeric string with dashes and underscores
<propertyName>
any
context
object
A map of key value pairs that you would like to be set as context attributes
context.<attributeName>
string, number or boolean
A set value of a custom context attribute. The attribute name can be an alphanumeric string with dashes and underscores
<propertyName>
any
For example, the response body of a Data request may look like this:
Whether you have sensitive data or frequently enter the same URL string, try setting up a in your workspace for enhanced security and efficiency.
Dynamic: Enabling the toggle allows you to view the header and provide it a custom value on the side panel when referencing information from a Data request in a flow
Production: The endpoint called in deployed applications when a is hit during conversation where this request is assigned
Development: Optional endpoint that can be called when in NLX
The application's used in the current conversation
The body of the request your API receives may contain the conversation context (nlx_context
) if the send context option is enabled in the data request settings. It will always include the properties defined in the Data request's .
The conversation context containing essential values such as the conversationId
and any that have been set up to this point in the conversation
The application's used in the current conversation
One or more set values corresponding to the schema defined in the data request's
The response body of your Data request should include the properties defined by the . Optionally, it can include the context object:
One or more set values corresponding to the schema defined in the data request's