I am working on an automation, to be able to search emails in an mailbox and then delte it using the REST API, but when I a going through the API document I am not able to find the rest. api to search and delete
can somebody help me with this please
REST API for searching emails and deleting them
-
- Posts: 1
- Joined: Thu Feb 03, 2022 5:11 am
Re: REST API for searching emails and deleting them
The Zimbra REST API is documented here: https://github.com/Zimbra/zm-mailbox/bl ... s/rest.txt
Search is available (see doc), but I do not believe there is any support for delete actions through that interface. You will need to use SOAP API (or some other interface) to delete items.
Search is available (see doc), but I do not believe there is any support for delete actions through that interface. You will need to use SOAP API (or some other interface) to delete items.
John Eastman
Re: REST API for searching emails and deleting them
Is there a way to return some email messages (like 10 or 100) OR some mail ids from Inbox using Zimbra API (for example: https://servername/home/username/inbox? ... =is:unread)? Thanks!
-
- Zimbra Employee
- Posts: 13
- Joined: Wed Oct 19, 2022 6:05 am
Re: REST API for searching emails and deleting them
By passing query parameter to the Rest API, you may obtain message information in JSON format and you can get message id from that message information.
You can refer this https://wiki.zimbra.com/wiki/Zimbra_Web ... earch_Tips to prepare QUERY_STRING.
Code: Select all
https://servername/home/username?fmt=json&query=QUERY_STRING
QUERY_STRING be like in:<FOLDERNAME> AND after:<MM/DD/YYY> AND before:<MM/DD/YYYY>
API request:
https://servername/home/username?fmt=json&query=in:<FOLDERNAME> AND after:<MM/DD/YYY> AND before:<MM/DD/YYYY>
Example: (below request provides Inbox folder's messages which received on 3-May-2023.)
https://servername/home/username?fmt=json&query=in:inbox AND after:5/2/2023 AND before:5/4/2023