> For the complete documentation index, see [llms.txt](https://telephony.shounakmulay.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://telephony.shounakmulay.dev/query-conversations.md).

# Query Conversations

{% hint style="danger" %}
**Requires&#x20;*****`READ_SMS`*****&#x20;permission.**
{% endhint %}

Add the following permission in your `AndroidManifest.xml`

```markup
<uses-permission android:name="android.permission.READ_SMS"/>
```

## getConversations()

#### Returns Future\<List<[SmsConversation](/query-conversations.md#smsconversation)>>

| Parameters | Type                                                               | Description                                                             | Optional | Default Value |
| :--------: | ------------------------------------------------------------------ | ----------------------------------------------------------------------- | :------: | ------------- |
|   Filter   | [`ConversationFilter`](/query-conversations.md#conversationfilter) | Filters the result by given constraints. Works like `SQL WHERE` clause. |    ✔️    | `null`        |
|  sortOrder | List of [`OrderBy`](/query-sms.md#orderby)                         | Sorts the result prioritized by order of declaration.                   |    ✔️    | `null`        |

```dart
List<SmsConversation> conversations = await telephony.getConversations(
        filter: SmsFilter.where(ConversationColumn.THREAD_ID)
                 .equals("12")
                 .and(ConversationColumn.SNIPPET)
                 .like("starwars"),
        sortOrder: [OrderBy(ConversationColumn.THREAD_ID, sort: Sort.ASC)]
        );
```

#### All parameters are optional.

```dart
List<SmsConversation> conversations = await telephony.getConversations();
```

## SmsConversation

| Property           | Type     |
| ------------------ | -------- |
| **`snippet`**      | `String` |
| **`threadId`**     | `int`    |
| **`messageCount`** | `int`    |

## ConversationColumn

| Values          |
| --------------- |
| **`SNIPPET`**   |
| **`THREAD_ID`** |
| **`MSG_COUNT`** |

## ConversationFilter

Works exactly like [`SmsFilter`](/query-sms.md#smsfilter) but works with [`ConversationColumn`](/query-conversations.md#conversationcolumn) instead of [`SmsColumn`](/query-sms.md#smscolumn)
