34
Views
1
Comments
 Integrating OutSystems API with Dialogflow Messenger: Issue with Webhook Response
Application Type
Reactive

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:

  1. Dialogflow Setup:

    • I have created an intent in Dialogflow called check_claim_status.
    • I added training phrases like "My claim ID is 102" to capture the user's input.
    • Dialogflow automatically suggested using the @sys.number system entity to capture the claim ID as a parameter.
    • In the Action and Parameters section, I named the action claim_id and set the parameter value to $number (the captured claim ID).
  2. Webhook Integration:

    • I have enabled the Webhook call for the check_claim_status intent.
    • I have configured a webhook fulfillment in Dialogflow that triggers an OutSystems API to fetch the claim status based on the claim ID.
    • My OutSystems API is set up to accept the claim ID and return a plain text response with the status (e.g., "approved", "pending").
  3. Dialogflow Webhook Configuration:

    • In Dialogflow's Fulfillment section, I have provided the OutSystems API URL and set the HTTP header to pass the claim_id parameter to the API.
  4. Current API Response:

    • The OutSystems API returns a simple text status like "approved" or "pending" based on the claim ID provided.

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:

  1. Incorrect Display of Response in Dialogflow Messenger:
    • Instead of appending the claim status returned from my OutSystems API, the bot response in Dialogflow Messenger shows something like:

      luaCopy codeYour claim status is: $webhookResponse.queryResult.parameters.status

    • This indicates that Dialogflow is not properly interpreting the webhook response. Instead of using the returned status from the API, it shows the literal variable name as part of the response.

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:

    • I need help understanding how to properly use the webhook response from the OutSystems API in Dialogflow Messenger.
    • Specifically, how can I append the claim status (returned as plain text from the API) to a complete response like "Your claim status is: approved" in Dialogflow Messenger?
  • API Response Format:

    • My API currently returns a simple text response (e.g., "approved"). Should I format the API to return JSON with a fulfillmentText field? If so, how exactly should I do that in OutSystems, and how should I configure Dialogflow to handle this?

What I'm Looking For:

  • Clear guidance on how to modify the webhook response in OutSystems or Dialogflow to properly display the claim status in the chatbot response.
  • Best practices for formatting and handling webhook responses in Dialogflow Messenger when integrating with an external API like OutSystems.

Technical Details:

  • OutSystems API: Returns a simple text response such as "approved" or "pending" based on the claim ID.
  • Dialogflow Messenger: Used for the chatbot interface.
  • Intent Name: check_claim_status
  • Webhook: Enabled for the intent and linked to the OutSystems API.

Any insights, examples, or suggestions on what I might be missing would be greatly appreciated. Thank you!

2025-09-25 14-38-22
Lokesh Kumar Yadav

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"

}


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.