# Conversation

## Conversation Start Event

When conversation has started with visitor, initiated by operator or visitor. Handler callback function will get data parameter with conversation data object.

#### Sample Code

```javascript
<script>
	window.acquire = window.acquire || [];
	window.acquire.push(function(app){
		app.on('conversation-start', (function(data){
			console.log('conversation started');
			console.log('conversation data =>', data);
		}));
	});
</script>
```

## Conversation End Event

When conversation has closed by operator. Handler callback function will get parameter with ended conversation id.

#### Sample Code

```javascript
<script>
   window.acquire = window.acquire || [];
   window.acquire.push(function(app){
      app.on('conversation-end', (function(conversation_id){
         console.log('conversation has been closed');
         console.log('conversation id =>', conversation_id);
      }));
   });
</script>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.acquire.io/master/js-api/js-live-chat-api/conversation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
