# quickReplyButtonClick Chat Widget API Problem

**URL:** <https://community.hubspot.com/t/quickreplybuttonclick-chat-widget-api-problem/97089>\
**Category:** APIs & Integrations\
**Tags:** free\
**Created:** [January 4, 2024, 10:49am UTC](https://community.hubspot.com/t/quickreplybuttonclick-chat-widget-api-problem/97089 "2024-01-04T10:49:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SergioDiMare](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sergiodimare/32/45423_2.png) [@SergioDiMare](https://community.hubspot.com/u/SergioDiMare)\
**Post date:** [January 4, 2024, 10:49am UTC](https://community.hubspot.com/t/quickreplybuttonclick-chat-widget-api-problem/97089/1 "2024-01-04T10:49:37Z")

</div>

I’m trying to use this code to capture user choice in the chatbot

```lia-code-sample
window.HubSpotConversations.on('quickReplyButtonClick', event => {
 console.log(`The text content of the clicked button is ${payload.value[0]}`);
});

```

that I found on this page

> **[Accounts Dashboard | HubSpot](https://app.hubspot.com/myaccounts?next=developerdocs&redirect=%2Fapi-reference%2Fconversations-visitor-identification-v3%2Fguide)**

So I wrote

```lia-code-sample
window.hsConversationsSettings = {};

	if (window.HubSpotConversations) {
		onConversationsAPIReady();
	} else {

		window.hsConversationsOnReady = [onConversationsAPIReady];
	}

function onConversationsAPIReady() {
	console.log(`HubSpot Conversations API:: ${window.HubSpotConversations}`);

	window.HubSpotConversations.on('quickReplyButtonClick', event => {
		console.log(`The text content of the clicked button is ${payload.value[0]}`);
	});

	window.HubSpotConversations.on('conversationStarted', payload => {
		console.log("ok");
		console.log(payload);
	});
}

```

The console.log(“ok”) event runs.  
The console.log(`The text content of the… event is not executed.

What am I doing wrong?

Thank you
