2
Query e-mails within a specific folder using GetMessages SmarterMail API v1
Question asked by krystal - 1/13/2021 at 7:48 AM
Unanswered
Hi Everyone,

I am trying to get the number of messages received within a certain timeframe. I am using the API below and was able to get messages however it seems to return all messages in the folder and doesn't seem to get the exact number of messages for the dates entered in "MessagesBefore" and "MessagesSince".

POST api/v1/mail/messages 
https://mail.smartertools.com/Documentation/api#/reference/SmarterMail.Web.Controllers.Api.MailController/GetMessages


Can anyone help me understand how messages can be properly queried using this API? Below is my post input, I didn't provide a query on it because I'm not sure how to query it, I tried to enter it in Odata format (in the URI and in the post input/body) but it still returns everything.

{  
"fieldsToSearch""Date",  // tried to use InternalDate here
"messagesSince""2021-01-12T00:00:00Z",  
"messagesBefore""2021-01-13T23:59:00Z",  
"ownerEmailAddress""user@domain.com",  
"folder""Read Receipts",  
"sortType""Date",  
"sortAscending"0
}

1 Reply

Reply to Thread
0
krystal Replied
I'm still unable to figure out how the messages within a folder can be filtered. Does anyone know? Is it even possible?

Reply to Thread