How get only unread email messages

I know we can get all email messages from a specific address using https://mailsac.com/api/addresses/{email}/messages but to get best results, we would like:

  • Get only unread messages
  • btw, the read field for all messages is not false as default. The returned json show it is equal to null. I spite of I opened a message, it continues showing read field as Null

We’re taking a look into this, ozrodm.

1 Like

As a side note, these are only going to be set to true by using the Unified Inbox, or by manually setting them as read with the API to set the read flag.

PUT /api/addresses/{email}/messages/{messageId}/read/true

1 Like

@ozrodm
I think mailsac should update the docs to indicate read may be null or bool.

To filter by read status, use andRead: true|false:

/api/inbox-filter?andTo=&andRead=false

1 Like

Oooh nice @ruffrey!!
I’ll testing it and let you know my results.

Thanks!

Hi @ruffrey,

It’s working fine. I test with read and unread messages and the andRead filter works fine!

Thank you!