Logout

Alt-N Discussion Groups > MDaemon Discussion Groups > MDaemon API > Get unread message count for a mail box

 [F] Alt-N Discussion Groups  / MDaemon Discussion Groups  / MDaemon API  /

Get unread message count for a mail box

[Johnston, Ian]
Ian Johnston
Newbie
Newbie
Posts: 4
Ian Johnston - 10:10am, Mar 3 2020

Does anyone know if it's possible to get the unread message count for a user's mail box via the API?.

I have trawled through the documentation and can't find anything that fits the bill

  All MessagesOldest ItemsOlder ItemsNewer ItemsNewest Items

Keith Personett (apparently) - Mar 3, 2020 11:39 am (#1 Total: 3)  

via email  

Photo of Author
Keith Personett
Newbie
Newbie
Posts: 76

Ian,

 

Unread counts can vary depending upon who is actually making the request, the folder owner, someone with shared access, etc…

If using a Service Account, then the flags returned are based on the folder owner by default.

It is the client’s responsibility to track read/unread counts.

 

This is the same way that protocols such as ActiveSync work.

 

You would get the list of items from a given folder using FolderOperation

 

<?xml version="1.0" encoding="utf-8"?>

<MDaemon>

  <API>

    <Request version="20.0.0" echo="1" verbose="0">

      <Operation>FolderOperation</Operation>

      <Parameters>

        <Folder account="the.watcher@marvel.int" action="get" path="MAILBOX/Inbox" children="true" recursive="true" acl="true" itemaction="list" itemorder="lastmodified" itemfiltertype="gt" itemfilterdate="2011-10-22T11:30:45.018Z" airsync="true" comments="true"/>

      </Parameters>

    </Request>

    <Response version="20.0" session="42541145" et="0.028812">

      <Status id="0" value="0x00000000" message="The operation completed successfully."/>

      <ServiceVersion>20.0.0.1c</ServiceVersion>

      <Result>

        <Folder action="get" account="The.Watcher@marvel.int" path="MAILBOX/Inbox" name="Inbox" lastmodified="2020-03-03T16:14:51.489Z" class="IPF.Note" childcount="0" itemcount="33">

          <ACL acecount="0" owner=""/>

          <Comments>Vur The  Watcher  cejiczau jeclu jubuheh sutoamein. Poan uwo tef taifaiwy egazuge cema vyjucujymy.</Comments>

          <EAS id="CI-00000000000000000000000000002" type="2"/>

          <!—elements removed for brevity à

          <Item ID="md5002000000060.msg" size="722" type="message" lastModified="2020-03-02T20:08:33.512Z"/>

          <Item ID="md5001000000061.msg" size="9391" type="message" lastModified="2020-03-02T20:21:57.062Z"/>

          <!—elements removed for brevity à

        </Folder>

      </Result>

    </Response>

  </API>

</MDaemon>

 

 

Then retrieve just the basic information for the items that have changed since you last retrieved the list, using ItemOperation.

To keep the size down, don’t specify a bodytype attribute on your get request, and you will receive just header and status information.

The Flags element contains message status bits.

 

<?xml version="1.0" encoding="utf-8"?>

<MDaemon>

  <API>

    <Request version="20.0.0" echo="1" verbose="0">

      <Operation>ItemOperation</Operation>

      <Parameters>

        <Item ID="md5002000000060.msg" path="MAILBOX/Inbox" type="message" action="get" account="the.watcher@marvel.int"/>

        <Item ID="md5001000000061.msg" path="MAILBOX/Inbox" type="message" action="get" account="the.watcher@marvel.int"/>

      </Parameters>

    </Request>

    <Response version="20.0" session="42541146" et="1.207787">

      <Status id="0" value="0x00000000" message="The operation completed successfully."/>

      <ServiceVersion>20.0.0.1c</ServiceVersion>

      <Result>

        <Item action="get" path="MAILBOX/Inbox" ID="md5002000000060.msg" account="the.watcher@marvel.int" lastModified="2020-03-02T20:08:33.000Z" type="message">

          <From displayname="MDaemon at xmen.int" address="H.E.R.B.I.E@xmen.int"/>

          <To>

            <Recipient displayname="The.Watcher@marvel.int" address="The.Watcher@marvel.int"/>

          </To>

          <ReplyTo>

            <Recipient displayname="noreply@xmen.int" address="noreply@xmen.int"/>

          </ReplyTo>

          <Subject>Welcome to the Xaviers-School mailing list</Subject>

          <Flags deleted="0" draft="0" flagged="0" forwarded="0" mdnsent="0" recent="0" replied="0" seen="1"/>

          <Received>2020-03-02T20:08:29.000Z</Received>

          <Date>2020-03-02T20:08:29.000Z</Date>

          <Priority>0</Priority>

          <ContentType>text/plain</ContentType>

          <Importance>1</Importance>

          <Priority>0</Priority>

          <MessageID>&lt;MDAEMON0119202003021408.AA0829765@xmen.int&gt;</MessageID>

          <MIMEVersion>1.0</MIMEVersion>

          <ThreadIndex>AdXxd3XnfDh2TgpQTAy/D9lc1/a2MQ==</ThreadIndex>

          <Categories count="0"/>

        </Item>

        <Item action="get" path="MAILBOX/Inbox" ID="md5001000000061.msg" account="the.watcher@marvel.int" lastModified="2020-03-02T20:21:57.000Z" type="message">

          <From displayname="MDaemon at marvel.int" address="H.E.R.B.I.E@marvel.int"/>

          <To>

            <Recipient displayname="The.Watcher@marvel.int" address="The.Watcher@marvel.int"/>

          </To>

          <ReplyTo>

            <Recipient displayname="H.E.R.B.I.E@marvel.int" address="H.E.R.B.I.E@marvel.int"/>

          </ReplyTo>

          <ReturnPath displayname="H.E.R.B.I.E@marvel.int" address="H.E.R.B.I.E@marvel.int"/>

          <Subject>MDaemon Bad Queue Summary - marvel.int - Mon Mar 02 2020 02:21 PM</Subject>

          <Flags deleted="0" draft="0" flagged="0" forwarded="0" mdnsent="0" recent="0" replied="0" seen="0"/>

          <Received>2020-03-02T20:21:56.000Z</Received>

          <Date>2020-03-02T20:21:56.000Z</Date>

          <Priority>0</Priority>

          <ContentType>text/html</ContentType>

          <Importance>1</Importance>

          <Priority>0</Priority>

          <MessageID>&lt;MDAEMON0002202003021421.AA2156157@marvel.int&gt;</MessageID>

          <MIMEVersion>1.0</MIMEVersion>

          <ThreadIndex>AdXxd3Xufj0LutFzTu+zuYmuhci0OA==</ThreadIndex>

          <Categories count="0"/>

        </Item>

        <Folder path="MAILBOX/Inbox" lastModified="2020-03-03T16:14:51.489Z" account="the.watcher@marvel.int"/>

      </Result>

    </Response>

  </API>

</MDaemon>

 

 

Keith Personett

Senior Software Developer, Cerebro Calibration Specialist, Agent of S.H.I.E.LD., Helicarrier Systems Analyst

MDaemon Technologies http://www.mdaemon.com/ or on Facebook

Sent using Outlook 2013 via ActiveSync Services for MDaemon Messaging Server.

I 16 1018

"You get hurt, hurt 'em back. You get killed... walk it off!"

                - Steve Rogers/Captain America


--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user
support and discussion.  MDaemon staff members may participate in the
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

Replies to this message
  • Ian Johnston (Apr 3, 2020 5:13 am)


  • Ian Johnston - Apr 3, 2020 5:13 am (#2 Total: 3)  

     

    Photo of Author
    Ian Johnston
    Newbie
    Newbie
    Posts: 4
    Replying to: Keith Personett (Mar 3, 2020 11:39 am)
    Ian,&nbsp;Unread counts can vary depending upon who is actually making the request, the folder owner, someone with shared access, etc…If...

    Hi Keith,

    Thanks for this

    It's really useful

    I'm sorry I didn't reply earlier

    Ian

    Keith Personett (apparently) - Apr 3, 2020 9:21 am (#3 Total: 3)  

    via email  

    Photo of Author
    Keith Personett
    Newbie
    Newbie
    Posts: 76

    Glad you like it.

     

    Hopefully, sometime after MDaemon 20.0 releases, and once I complete some work items for MD 20.5, I hope to work on some new additions to the API. If there are features you would like to see in the API, please let me know.

     

    Keith Personett

    Senior Software Developer, Cerebro Calibration Specialist, Agent of S.H.I.E.LD., Helicarrier Systems Analyst

    MDaemon Technologies http://www.mdaemon.com/ or on Facebook

    Sent using Outlook 2013 via ActiveSync Services for MDaemon Messaging Server.

    I 16 1018

    "You get hurt, hurt 'em back. You get killed... walk it off!"

                    - Steve Rogers/Captain America

     
    
    --MD-API-------------------------------------------------------------
    This list is for questions and discussions regarding MDAEMON's API.
    To unsubscribe from this mailing list send an email to
    md-api-unsubscribe@mdaemon.com .
    --POWERED BY MDAEMON!------------------------------------------------
    
    ---------------------------------------------------------------------
    These forums are provided by MDaemon Technologies for user-to-user
    support and discussion.  MDaemon staff members may participate in the
    forums periodically but please recognize that this is not the official
    method of receiving technical support. To receive personal technical
    support please use the form here:
    http://www.mdaemon.com/support/request_support.asp
    ---------------------------------------------------------------------
    



      All MessagesOldest ItemsOlder ItemsNewer ItemsNewest Items



     Content:

    Read New | Search

     Guest:

    Email to Admin



    You are visiting as a Guest user.