2022-10-07 08:46:39 +02:00
|
|
|
# Search
|
|
|
|
|
|
|
|
**URL** : `api/v1/search?query=<string>`
|
|
|
|
|
|
|
|
**Method** : `GET`
|
|
|
|
|
2022-10-14 06:38:22 +02:00
|
|
|
The search returns the most recent matches (default 50).
|
2022-10-07 08:46:39 +02:00
|
|
|
Matching messages are returned in the order of latest received to oldest.
|
|
|
|
|
|
|
|
|
|
|
|
## Query parameters
|
|
|
|
|
2022-10-14 06:27:09 +02:00
|
|
|
| Parameter | Type | Required | Description |
|
|
|
|
|-----------|---------|----------|----------------------------|
|
|
|
|
| query | string | true | Search query |
|
|
|
|
| limit | integer | false | Limit results (default 50) |
|
|
|
|
| start | integer | false | Pagination offset |
|
2022-10-07 08:46:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
## Response
|
|
|
|
|
|
|
|
**Status** : `200`
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"total": 500,
|
|
|
|
"unread": 500,
|
|
|
|
"count": 25,
|
|
|
|
"start": 0,
|
|
|
|
"messages": [
|
|
|
|
{
|
|
|
|
"ID": "1c575821-70ba-466f-8cee-2e1cf0fcdd0f",
|
2023-05-30 22:20:05 +02:00
|
|
|
"MessageID": "12345.67890@localhost",
|
2022-10-07 08:46:39 +02:00
|
|
|
"Read": false,
|
|
|
|
"From": {
|
|
|
|
"Name": "John Doe",
|
|
|
|
"Address": "john@example.com"
|
|
|
|
},
|
|
|
|
"To": [
|
|
|
|
{
|
|
|
|
"Name": "Jane Smith",
|
|
|
|
"Address": "jane@example.com"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"Cc": [
|
|
|
|
{
|
|
|
|
"Name": "Accounts",
|
|
|
|
"Address": "accounts@example.com"
|
|
|
|
}
|
|
|
|
],
|
2022-11-06 01:32:03 +02:00
|
|
|
"Bcc": [],
|
2022-10-07 08:46:39 +02:00
|
|
|
"Subject": "Test email",
|
|
|
|
"Created": "2022-10-03T21:35:32.228605299+13:00",
|
|
|
|
"Size": 6144,
|
|
|
|
"Attachments": 0
|
|
|
|
},
|
|
|
|
...
|
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### Notes
|
|
|
|
|
|
|
|
- `total` - Total messages in mailbox (all messages, not search)
|
|
|
|
- `unread` - Total unread messages in mailbox (all messages, not search)
|
2022-10-14 06:38:22 +02:00
|
|
|
- `count` - Number of messages returned in request
|
|
|
|
- `start` - The offset (default `0`) for pagination
|
2022-10-07 08:46:39 +02:00
|
|
|
- `From` - Singular Name & Address, or null if none
|
2022-11-06 01:32:03 +02:00
|
|
|
- `To`, `CC`, `BCC` - Array of Name & Address
|
2022-10-07 08:46:39 +02:00
|
|
|
- `Size` - Total size of raw email in bytes
|