Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How to send custom payloads with webhook response

Hi guys,

This might be a dumb question, but does anyone know how to send custom payloads (specifically chips) with the webhook response in dialogflowCX?

This is my current webhook response:

res = {
  "fulfillmentResponse": {
    "messages": [
      {
        "text": {
          "text": [
            "Reply Text"
          ]
        }        
      }
    ]
},
}



Solved Solved
0 2 345
1 ACCEPTED SOLUTION

Hi,

You will need to specify something like this under the payload property, you can use my library as reference: https://github.com/xavidop/dialogflow-cx-messenger-ts:

{
 
"richContent": [
   
[
     
{
       
"type": "chips",
       
"options": [
         
{
           
"mode": "blocking",
           
"text": "Chip 1",
           
"image": {
             
"rawUrl": "https://example.com/images/logo.png"
           
},
           
"anchor": {
             
"href": "https://example.com"
           
}
         
},
         
{
           
"text": "Chip 2",
           
"image": {
             
"rawUrl": "https://example.com/images/logo.png"
           
},
           
"anchor": {
             
"href": "https://example.com"
           
}
         
}
       
]
     
}
   
]
 
]
}

 

View solution in original post

2 REPLIES 2

Hi,

You will need to specify something like this under the payload property, you can use my library as reference: https://github.com/xavidop/dialogflow-cx-messenger-ts:

{
 
"richContent": [
   
[
     
{
       
"type": "chips",
       
"options": [
         
{
           
"mode": "blocking",
           
"text": "Chip 1",
           
"image": {
             
"rawUrl": "https://example.com/images/logo.png"
           
},
           
"anchor": {
             
"href": "https://example.com"
           
}
         
},
         
{
           
"text": "Chip 2",
           
"image": {
             
"rawUrl": "https://example.com/images/logo.png"
           
},
           
"anchor": {
             
"href": "https://example.com"
           
}
         
}
       
]
     
}
   
]
 
]
}

 

Sorted! Thank you @xavidop