I am working on integrating Dialogflow Messenger with an OutSystems application. My goal is to enable the chatbot to retrieve real-time data from the OutSystems API, specifically the claim status when a customer asks, "What is my claim status?" followed by their claim ID.
What I Have Done So Far:
Dialogflow Setup:
Webhook Integration:
Dialogflow Webhook Configuration:
Current API Response:
The Problem:
When I test the bot by asking "What is my claim status?" followed by a claim ID (e.g., "My claim ID is 102"), I face the following issues:
luaCopy codeYour claim status is: $webhookResponse.queryResult.parameters.status
What I've Tried:
I initially attempted to access the webhook response using $webhookResponse.queryResult.parameters.status in the Dialogflow Response section, but this resulted in the variable name being displayed rather than the actual status.
I later learned that using $webhookResponse is incorrect because Dialogflow does not directly expose webhook responses this way. Instead, Dialogflow requires specific fields like fulfillmentText to be used.
Where I Am Stuck:
Webhook Response Handling in Dialogflow:
API Response Format:
What I'm Looking For:
Technical Details:
Any insights, examples, or suggestions on what I might be missing would be greatly appreciated. Thank you!
To properly integrate the claim status response from your OutSystems API into Dialogflow Messenger, you need to ensure that the OutSystems API returns the response in a JSON format with a fulfillmentText field. Dialogflow expects responses from the webhook to be structured in JSON, not as plain text. For example, the OutSystems API should return a JSON object like:
jsonCopyEdit
{
"fulfillmentText": "Your claim status is: approved"
}
This allows Dialogflow to correctly interpret and display the response. In Dialogflow’s fulfillment, you should reference the returned value as $status within the fulfillmentText field. So, your Dialogflow webhook response should look like:
"fulfillmentText": "Your claim status is: $status"