How to invoke a rich response button in Diagflow CX through API

I have a diagflow agent that it does return a custom Payload (buttons which transition the session to another flow). Also I have a standalone client (Java client) that queries the Diagflow agent and return response back to the End User.

Users will interact with the Diagflow agent through Java client developed using google Java SDK. I need help in how can I invoke action button that is retuned by diagflow agent in my Java Client, so the User is transitioned to another flow?

Below is the custom payload response after calling detectIntent function on SessionClient.

Type: payload
payload {
  fields {
    key: "richContent"
    value {
      list_value {
        values {
          list_value {
            values {
              struct_value {
                fields {
                  key: "event"
                  value {
                    struct_value {
                      fields {
                        key: "name"
                        value {
                          string_value: "EN_TXT"
                        }
                      }
                    }
                  }
                }
                fields {
                  key: "icon"
                  value {
                    struct_value {
                      fields {
                        key: "color"
                        value {
                          string_value: "#FF9800"
                        }
                      }
                      fields {
                        key: "type"
                        value {
                          string_value: "chevron_right"
                        }
                      }
                    }
                  }
                }
                fields {
                  key: "link"
                  value {
                    string_value: ""
                  }
                }
                fields {
                  key: "text"
                  value {
                    string_value: "English"
                  }
                }
                fields {
                  key: "type"
                  value {
                    string_value: "button"
                  }
                }
              }
            }
            values {
              struct_value {
                fields {
                  key: "event"
                  value {
                    struct_value {
                      fields {
                        key: "name"
                        value {
                          string_value: "\331\220AR_TXT"
                        }
                      }
                    }
                  }
                }
                fields {
                  key: "icon"
                  value {
                    struct_value {
                      fields {
                        key: "color"
                        value {
                          string_value: "#FF9800"
                        }
                      }
                      fields {
                        key: "type"
                        value {
                          string_value: "chevron_right"
                        }
                      }
                    }
                  }
                }
                fields {
                  key: "link"
                  value {
                    string_value: ""
                  }
                }
                fields {
                  key: "text"
                  value {
                    string_value: "\330\271\330\261\330\250\331\212"
                  }
                }
                fields {
                  key: "type"
                  value {
                    string_value: "button"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Hi!

Welcome to Google Cloud Community!

To properly address your concern, can you clarify below:

  1. Does your JAVA program have a UI?
  2. If yes, are you trying to have a rich response button on the JAVA UI?
  3. Can you show a screenshot of the output of your current payload code?