# vx_req_account_archive_query

> Reference the Vivox Core SDK API.

Query messages that were archived by the server for the specified account.  [More...](#detailed-description)

`#include <VxcRequests.h>`

## Public Attributes

|                                                        | Name                                                                                                                                                            |
| ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [vx\_req\_base\_t](./_vxc_8h.md#typedef-vx_req_base_t) | **[base](./structvx__req__account__archive__query.md#variable-base)** The common properties for all requests.                                                   |
| [VX\_HANDLE](./_vxc_8h.md#typedef-vx_handle)           | **[account\_handle](./structvx__req__account__archive__query.md#variable-account_handle)** The handle returned from a successful login request.                 |
| char \*                                                | **[time\_start](./structvx__req__account__archive__query.md#variable-time_start)** Exclude all messages before a specified date or time from the query results. |
| char \*                                                | **[time\_end](./structvx__req__account__archive__query.md#variable-time_end)** Exclude all messages after a specified date or time from the query results.      |
| char \*                                                | **[cursor](./structvx__req__account__archive__query.md#variable-cursor)** When requesting the first page of results, this value can remain nullptr or empty.    |
| char \*                                                | **[search\_text](./structvx__req__account__archive__query.md#variable-search_text)** The text to find in the query.                                             |
| char \*                                                | **[channel\_uri](./structvx__req__account__archive__query.md#variable-channel_uri)** The fully specified URI of the channel.                                    |
| char \*                                                | **[participant\_uri](./structvx__req__account__archive__query.md#variable-participant_uri)** The fully specified URI of the participant.                        |
| char \*                                                | **[display\_name](./structvx__req__account__archive__query.md#variable-display_name)** The display name of the participant.                                     |
| unsigned int                                           | **[max](./structvx__req__account__archive__query.md#variable-max)** The maximum number of messages to find in the query.                                        |
| char \*                                                | **[before\_id](./structvx__req__account__archive__query.md#variable-before_id)** The message\_id for paging backward through large query result sets.           |
| char \*                                                | **[after\_id](./structvx__req__account__archive__query.md#variable-after_id)** The message\_id for paging forward through large query result sets.              |
| int                                                    | **[first\_message\_index](./structvx__req__account__archive__query.md#variable-first_message_index)** The index of the first message to retrieve.               |
| char \*                                                | **[application\_stanza\_namespace](./structvx__req__account__archive__query.md#variable-application_stanza_namespace)**                                         |
| char \*                                                | **[application\_stanza\_body](./structvx__req__account__archive__query.md#variable-application_stanza_body)**                                                   |

## Detailed Description

```cpp
struct vx_req_account_archive_query;
```

Query messages that were archived by the server for the specified account.

**See**: [vx\_req\_session\_archive\_query](./structvx__req__session__archive__query.md)

This includes all messages that are sent and received by this account, including directed messages and channel messages. Messages can appear in the archive with a delay of up to several seconds after being sent or received. To query a specific channel's history, use [vx\_req\_session\_archive\_query](./structvx__req__session__archive__query.md).

## Public Attributes Documentation

### variable base

```cpp
vx_req_base_t base;
```

The common properties for all requests.

### variable account\_handle

```cpp
VX_HANDLE account_handle;
```

The handle returned from a successful login request.

### variable time\_start

```cpp
char * time_start;
```

Exclude all messages before a specified date or time from the query results.

Specify the start time by using a format defined in XEP-0082. This is optional. The default setting is NULL.

### variable time\_end

```cpp
char * time_end;
```

Exclude all messages after a specified date or time from the query results.

Specify the end time by using a format defined in XEP-0082. This is optional. The default setting is NULL.

### variable cursor

```cpp
char * cursor;
```

When requesting the first page of results, this value can remain nullptr or empty.

Responses provide a next\_cursor value pointing to the next page of results when the result size is greater than the page size. Set the cursor value with the next\_cursor from previous responses when applicable.

### variable search\_text

```cpp
char * search_text;
```

The text to find in the query.

Only messages that contain the specified text are returned. This is optional. The default setting is NULL.

### variable channel\_uri

```cpp
char * channel_uri;
```

The fully specified URI of the channel.

**Note**: This is mutually exclusive with participant\_uri.

Only messages to or from the specified channel are returned. This is optional. The default setting is NULL.

### variable participant\_uri

```cpp
char * participant_uri;
```

The fully specified URI of the participant.

**Note**: This is mutually exclusive with channel\_uri.

Only messages to or from the specified participant are returned. This is optional. The default setting is NULL.

### variable display\_name

```cpp
char * display_name;
```

The display name of the participant.

The default setting is NULL.

### variable max

```cpp
unsigned int max;
```

The maximum number of messages to find in the query.

This is optional. The default value is 10. Set to 0 to get the total message count without retrieving the messages.

### variable before\_id

```cpp
char * before_id;
```

The message\_id for paging backward through large query result sets.

**Note**: This parameter cannot be used simultaneously with parameter after\_id. This is optional. The default setting is NULL.

The query results include messages that immediately precede the specified message in the result set.

### variable after\_id

```cpp
char * after_id;
```

The message\_id for paging forward through large query result sets.

**Note**: This parameter cannot be used simultaneously with parameter before\_id. This is optional. The default setting is NULL.

The query results include messages that immediately follow the specified message in the result set.

### variable first\_message\_index

```cpp
int first_message_index;
```

The index of the first message to retrieve.

This is optional. The default setting is -1, which indicates to not use this parameter. The first message in the result set always has an index of 0.

### variable application\_stanza\_namespace

```cpp
char * application_stanza_namespace;
```

**Deprecated**:

This is deprecated and should not be used. The namespace of the custom application stanza.

### variable application\_stanza\_body

```cpp
char * application_stanza_body;
```

**Deprecated**:

This is deprecated and should not be used. The body of the custom application stanza.
