# Get last read message information from a given channel

> Learn how to retrieve the last read message in a channel.

To get the last read message information, you need to sign in and connect to at least one channel. You can then use vx\_req\_account\_chat\_history\_get\_last\_read to make a request. This will return:

* The last read message ID
* The time stamp of when that message was read
* The number of messages that are unread in the specified channel

> **Note:**
>
> Last read information is updated when a user disconnects from a specified channel.

The following code is an example of how to get the last read information from a channel. This assumes that you have already successfully added a session.

```plaintext
vx_req_account_chat_history_get_last_read *req;
vx_req_account_chat_history_get_last_read_create(&req);
req->account_handle = vx_strdup("sip:.issuer.playerName@mt1s.vivox.com");
req->session_handle = vx_strdup("mychannel");
vx_issue_request2(&req->base);
```

After you receive this information, the game then must process the vx\_resp\_account\_chat\_history\_get\_last\_read\_t response:

```plaintext
void HandleAccountGetLastReadResponse(vx_resp_account_chat_history_get_last_read_t *resp)
{
    // Handles the response, uses the number of unread messages to fetch history
}
```
